Jump to content


Photo

Newb Question?


  • Please log in to reply
1 reply to this topic

#1 biscutty

biscutty
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 11 August 2003 - 11:40 AM

How can I extract the actual value of customerID to a variable from the result of the following query?

:?

PHP:
--------------------------------------------------------------------------------

$result = @mysql_query(\"SELECT customerID FROM customers WHERE dirNAME = \'.$jclogin.\'\");

--------------------------------------------------------------------------------


Thanks
?>[/code]

#2 DylanBlitz

DylanBlitz
  • Members
  • PipPipPip
  • Advanced Member
  • 99 posts
  • LocationOC Baby!

Posted 11 August 2003 - 03:45 PM

[php:1:5c656c3b10]
$result = @mysql_query(\"SELECT customerID FROM customers WHERE dirNAME = \'.$jclogin.\'\");
if (!$result) { echo mysql_errno().\": \".mysql_error().\"n\"; exit; }

$custdata = mysql_fetch_array($result);
$customerID = $custdata[customerID];
[/php:1:5c656c3b10]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users