Hi everyone,
I'm using a MySQL DB and a search form. Eveery thing works fine, but
when
I
upload, it has a Error in query. I checked all the little details but
can't
find out why? Any ideas are welcome.
Jacco
This one is an easy problem to fix. All you have to do is find the error
and
sorry for my furry message before.
I search a DB in multiple search fields and my result code looks like this:
?PHP
$db=test;
$table=airline_a;
if (! $link)
die( couldn't connect);
mysql_select_db($db)
or die (won't open test:.mysql_error() );
$db_res=mysql_list_dbs($link);
That's some nasty code
Two things:
1. What is $ton in your query?
2. Change your mysql_query row to this:
$result = mysql_query($query) or die(MySQL Error: .mysql_error().brSQL:
$query);
So when your query dies, you'll know why.
Peter
On Sun, 27 Oct 2002, Seabird wrote:
sorry
$ton is my AND/OR field. I'll change my error code and post it, thanx,
Jacco
--
http://seabird.jmtech.ca
Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching
Peter Beckman [EMAIL PROTECTED] wrote in message
My error came out like this:
MySQL Error: You have an error in your SQL syntax near 'Field2 LIKE '%%'
Field3 LIKE '%%' ORDER BY ' at line 2
SQL: SELECT * FROM airline_a WHERE Field1 LIKE '%%' Field2 LIKE '%%' Field3
LIKE '%%' ORDER BY
Why does it not do this at my localhost?? I have the % around
MySQL Error: You have an error in your SQL syntax near 'Field2 LIKE
'%%'
Field3 LIKE '%%' ORDER BY ' at line 2
SQL: SELECT * FROM airline_a WHERE Field1 LIKE '%%' Field2 LIKE '%%'
Field3
LIKE '%%' ORDER BY
You need some ANDs between each of your field LIKE '%%' clauses.
WHERE field1 LIKE
It seems to me you have no idea what you are doing. You really need to
learn how to troubleshoot your code, as this is a very simple problem to
fix. It's not your code. The variables you put in your SQL are empty.
Your code:
$query = SELECT * FROM $table WHERE Field1 LIKE '%$icao%' $ton
Hi Peter I understand your frustration,
but how come that it works fine on my localhost, prosessing the exact same
code?? I thought it worked because it works fine locally
What is the differense in my code posted locally and remote?
Jacco
--
http://seabird.jmtech.ca
Attitude is Everything!
I also provide my searchform here. The problem I have is that everything
works when run on my localhost (which is my testing location before upload.
I have the exact same code local and remote.
My searchform should pass the code. here it comes:
form method=GET action=aviation/result.php
Please stop responding to the list. Your problems are far to simple to
bother everyone on the list.
I have no idea what you mean when you say locally or remote.
Basically your problem is that your script does not see any of the
variables. They are empty or not set. They are not getting passed
First off, use quotes. If you are going to be a good coder, always use
quotes in your HTML and your PHP.
form method=GET action=aviation/result.php target=frameData
In PHP:
$table=aviation_a; // NOT $table=aviation_a;
Sure, they both work, but they can cause problems in the future, and it
11 matches
Mail list logo