473,385 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

list() query not working

Hello,

When I run the code below when $entry = miami.com, I get the following error message:

SELECT COUNT(*) FROM #&*+ WHERE `site` LIKE 'miami.com':You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
It looks like I'm not correctly defining $table. Any ideas how I could do that?

Thanks in advance,

John


Expand|Select|Wrap|Line Numbers
  1. $result = mysql_query("SHOW TABLES FROM feather") 
  2. or die(mysql_error()); 
  3.  
  4.  
  5. while(list($table)= mysql_fetch_row($result))
  6. {
  7.   $sqlA = "SELECT COUNT(*) FROM $table WHERE `site` LIKE '$entry'";
  8.   $resA = mysql_query($sqlA) or die("$sqlA:".mysql_error());
  9.   list($isThere) = mysql_fetch_row($resA);
  10.   if ($isThere)
  11.   {
  12.      $table_list[] = $table;
  13.   }
  14. }
Jun 16 '09 #1
2 1165
hsriat
1,654 Expert 1GB
I think '%' is missing.
http://dev.mysql.com/doc/refman/5.0/...-matching.html
Jun 16 '09 #2
prabirchoudhury
162 100+
hey.

If no wildcard characters (%%, …, _) are used then there should be no difference in
performance between
Expand|Select|Wrap|Line Numbers
  1. “… WHERE site='$entry' ” and “..WHERE site LIKE '$entry'”
the two queries . so , I think you need to check with your query and passing variable matches.


:)
Jun 16 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Dave Hopper | last post by:
Hi I posted a question recently regarding problems I am having getting a value from a list box to use in a query. I got a lot of help, for which I thank you and it's nearly working! But I need...
5
by: SuffrinMick | last post by:
Hello - I'm a newbie to coding! I'm working on an access 2000 database which has three tables: tblContacts - A list of customer contacts. tblOrgTypes - A list of organisational types....
2
by: ormy28 | last post by:
I really need some help with the following problem if anyone would be willing. I need a list box to list the opposite of what appears in a query. Heres the details: My database is for a...
2
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
10
by: Ben | last post by:
Hi, I am a newbie with C and am trying to get a simple linked list working for my program. The structure of each linked list stores the char *data and *next referencing to the next link. The...
7
by: aaron.kempf | last post by:
team so i have a nice little list in sharepoint.. about 15k items i've got the simplest little join statement in access; and im trying to UPDATE the sharepoint list via an access query. so...
2
by: deja | last post by:
Hello, I am creating an a to z list - basically a count of all results that start with the letter "A", "B", "C" .... and so on. I am pretty poor at SQL so I am sure some brains out there can...
3
by: idletask | last post by:
I have an application that has many windows. One window is used for order processing. I would like this window to display the other users who are also performing order processing (the idea is to...
3
by: rhobson2 | last post by:
Hello, I wrote a database applicaiton using Access XP (2002) and everything has been working good for the client until they purchased a couple of new computers with Access 2003. The meetings...
17
by: trose178 | last post by:
Good day all, I am working on a multi-select list box for a standard question checklist database and I am running into a syntax error in the code that I cannot seem to correct. I will also note...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.