Jump to content


Photo

Query Failing, need help


  • Please log in to reply
2 replies to this topic

#1 kruzayn

kruzayn
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 05 May 2006 - 10:06 PM

//get product ID for just entered item

$sqlgetid= "select product_id from jos_vm_product where product_sku=$sku";
$productid=mysql_query($sqlgetid) or die ("FAILED2");

Can anyone tell my why this is failing?

I am entering items into a database, with product_id being automatically assigned. the line above this one works and enters them like needed into the DB, but this one fails. I need to store the product id (ex: 1567) in $productid.

Thanks for any help!

kruz

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 05 May 2006 - 10:09 PM

Add single quotes around $sku.

Info: PHP Manual


#3 kruzayn

kruzayn
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 06 May 2006 - 08:45 PM

[!--quoteo(post=371723:date=May 5 2006, 05:09 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ May 5 2006, 05:09 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Add single quotes around $sku.
[/quote]


i knew it was something stupid, had been at it for quite a few hours, ran it and that part failed.

Thanks!

kruzayn




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users