php - Getting data from a mySQL query -


i'm having simple issue mysql. don't know syntax well.

code:

$rego_select = mysql_query(   "select vechicleregistration trucks truckid = '$truckid'" )    or die("problem reading table: " . mysql_error());` 

if try echo $rego_select directly outputs resource locater #. wondering function can use data column.

i tried use mysql_result(); requires position number makes life difficult because executing query dynamically in while statement , have re write whole loop structure if way it.

cheers guys.

you should able use mysql_result(). position requires position in result. when executing query that, there's 1 result. mysql_result($rego_select,0) should yield result.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -