HighDots Forums  

PHP sequence error

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss PHP sequence error in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Adrian Leontovich
 
Posts: n/a

Default PHP sequence error - 03-01-2004 , 01:37 AM






I'm trying to retrieve a recordset, where one value in the mySQL table/field
= the letter W. When I run the .php file on the testing server, I get the
message:

You have an error in your SQL syntax near 'W''' at line 1

Anyone have any ideas why? Here's teh syntax:

<?php
mysql_select_db($database_booklist, $booklist);
$query_wants = "SELECT * FROM books WHERE have_want = ''W''";
$wants = mysql_query($query_wants, $booklist) or die(mysql_error());
$row_wants = mysql_fetch_assoc($wants);
$totalRows_wants = mysql_num_rows($wants);

mysql_select_db($database_booklist, $booklist);
$query_has = "SELECT * FROM books WHERE have_want = ''H''";
$has = mysql_query($query_has, $booklist) or die(mysql_error());
$row_has = mysql_fetch_assoc($has);
$totalRows_has = mysql_num_rows($has);
?>



Reply With Quote
  #2  
Old   
Steve Fleischer
 
Posts: n/a

Default Re: PHP sequence error - 03-01-2004 , 01:49 AM






On Sun, 29 Feb 2004 22:37:02 -0800, Adrian Leontovich wrote:

Quote:
I'm trying to retrieve a recordset, where one value in the mySQL table/field
= the letter W. When I run the .php file on the testing server, I get the
message:

You have an error in your SQL syntax near 'W''' at line 1

Anyone have any ideas why? Here's teh syntax:

?php
mysql_select_db($database_booklist, $booklist);
$query_wants = "SELECT * FROM books WHERE have_want = ''W''";
$wants = mysql_query($query_wants, $booklist) or die(mysql_error());
$row_wants = mysql_fetch_assoc($wants);
$totalRows_wants = mysql_num_rows($wants);

I think you need to replace this line:

$query_wants = "SELECT * FROM books WHERE have_want = ''W''";

with this:

$query_wants = "SELECT * FROM books WHERE have_want = 'W'";

--
Steve
www dot flyingtigerwebdesign dot com
Hong Kong, 01-Mar-04 2:46:55 PM


Reply With Quote
  #3  
Old   
Adrian Leontovich
 
Posts: n/a

Default Re: PHP sequence error - 03-01-2004 , 08:21 PM



Thats true Steve... that does now work.. wonder why DW wants to put in
double ticks?

Also.. I know how to pass URL parameters to a Details page using ASP, but
this function seems to be missing when I'm tryin gto build in PHP.. any
ideas how to do this?

Anyone?



Reply With Quote
  #4  
Old   
Steve Fleischer
 
Posts: n/a

Default Re: PHP sequence error - 03-01-2004 , 08:53 PM



On Mon, 1 Mar 2004 17:21:19 -0800, Adrian Leontovich wrote:

Quote:
Thats true Steve... that does now work.. wonder why DW wants to put in
double ticks?

Also.. I know how to pass URL parameters to a Details page using ASP, but
this function seems to be missing when I'm tryin gto build in PHP.. any
ideas how to do this?
Just replied in the other thread. :-)
--
Steve
www dot flyingtigerwebdesign dot com
Hong Kong, 02-Mar-04 9:53:42 AM


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.