Jump to content

select field in array and refer the value in javascript ?


sayedsohail

Recommended Posts

$result = mysql_query("SELECT * FROM table1")
$row = mysql_fetch_array($result);
$lname = $row['lname'];

thats for general columns, if you want specific ones like lname:
change:
$result = mysql_query("SELECT * FROM table1")
to
$result = mysql_query("SELECT lname FROM ")
rest stays the same
but i dont understand what do you mean by array.
Ted
Thanks for the help, here is the scenario

My first table select statement
select lname, fname,member_id, id from table1;

and onclick I wish to pass $member_id, $id through a javascript function i.e., onclick=checkvalues("Myform", $id,$member_id)

so my next query will have a choice to select data from either of this two values ie., id or member_id,  however, i don't want to display member_id in my first output, that is why i thought of storing member_id in a separate array and referring it in my onlick statement.

My logic is bit strange and i apologize for that. 

Can you advise?  Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.