Re: Thanks but problem Again! (MySQL & PHP database script PLEASE)
| From: | Ramil Sagum | Date: | Fri, 22 Oct 2004 07:50:09 +0000 |
| Subject: | Re: Thanks but problem Again! (MySQL & PHP database script PLEASE) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-200067@lists.php.net to get a copy of this message | ||
On Fri, 22 Oct 2004 16:13:07 +0900, Sugimoto <sugimoto@momat.go.jp> wrote:
> Thank you for two of you.
dou itashimashite.
This is your problem:
> Bad query: You have an error in your SQL syntax near 'and Tit like and Aut
> like and Auty like ' at line 4
The SQL query you formed may have an invalid syntax. Dakara, $result
does not contain a valid MySQL resource. Mochiron, next operations
with $result will produce errors:
> Warning: mysql_num_rows(): supplied argument is not a valid MySQL result...
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result....
What you can do is to debug first your SQL statement:
$sql = "select * from gen_table where GO like ". $_GET["go"].
" and ym like ". $_GET["dt"] .
" and Tit like ".$_GET["ti"]." .
" and Aut like ".$_GET["au"].
" and Auty like ".$_GET["ay"];
print_r($sql); //show the SQL statement, (remove this when everything
is working)
$result = mysql_query($sql);
print_r to var_dump ha php de debug no ni yaku ni tachimasu!
----
ramil
http://ramil.sagum.net
--
----
ramil
http://ramil.sagum.net