Hello everyone!
Can anyone tell me on how can i code using php the query on mysql database that gets a single value from it? i have here my code
This code allows me to get a value from the database but the problem is i can only get the first value on my database i can't get the value in the database if it is not on the first row. Can anyone tell me of my mistake here?
Im new to PHP and MYSQL environment.
I will really appreciate any help.
Thanks
Can anyone tell me on how can i code using php the query on mysql database that gets a single value from it? i have here my code
Code:
$this->SetCon();
$orgSQL = "SELECT org_id FROM users WHERE org_name = '$orgName';";
$org_query_result = mysql_query($orgSQL);
$org_key;
while($row = mysql_fetch_row($org_query_result, MYSQL_ASSOC))
{
$org_key = $row['org_id'];
}
return $org_key;
Im new to PHP and MYSQL environment.
I will really appreciate any help.
Thanks
Comment