» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2006, 04:29 PM
jackson jackson is offline
Junior Member
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
jackson is on a distinguished road
Default solve my query error

Hi, solve my query plz

I've got a form where the user picks a value from a drop down list. The list is populated from a MySQL db using a value and the primary key for that value.

When the user presses "edit", another query is supposed to run that pulls the remaining fields that match the key. But it doesn't.

My code:

PHP Code:
$db = mysql_connect(XXX) or die ("Couldn't connect to server");
mysql_select_db(XXX,$db) or die ("Couldn't connect to database");
$query="SELECT * FROM prod WHERE key = '".$record."'";
$result = mysql_query($query,$db);

if (!$result) {
echo mysql_error();
die;
}

$row = mysql_fetch_array($result);

The error I get:


Quote:
You have a -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 07-31-2006, 04:31 PM
seoexpert seoexpert is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
seoexpert is on a distinguished road
Default

Lara
Integers shouldn't have quotes around them, but that shouldn't raise an error. Please echo your entire $query variable and post it. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #3  
Old 07-31-2006, 04:35 PM
jackson jackson is offline
Junior Member
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
jackson is on a distinguished road
Default

removing the quotes, this is my query:

Quote:
SELECT * FROM prod WHERE key = 50 -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #4  
Old 07-31-2006, 04:37 PM
destiny destiny is offline
OSP Starters
 
Join Date: Mar 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
destiny is on a distinguished road
Default

KEY is a reserved word. You should rename your column
(you can also surround it in backticks). -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Execution Error Mara MySQL Forums 1 03-07-2007 09:51 AM
error while installation. Paola MySQL Forums 0 12-12-2006 04:43 AM
mysql error: error 28.... Jaida MySQL Forums 1 08-16-2006 06:34 AM
upgraded 3.23 to 5.0.16 and inner join query gives an error???? Kendrick MySQL Forums 0 08-01-2006 01:18 PM
ASP Error Codes - Description dam Introductions 1 12-07-2005 10:09 AM


All times are GMT. The time now is 10:20 AM.