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
Expand|Select|Wrap|Line Numbers
- $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