Jump to content

set results to variable


kev wood

Recommended Posts

i want to pull a result from a mysql table but instead of echoing the result out i want to set it to equal a variable.  would the code look like this

 

$query = "SELECT email_count FROM sent_messages";
$result=mysql_query($query);

while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
$sent_mail = $row['sent_messages'];

 

it is the line with $sent_mail i am unsure about

Link to comment
https://forums.phpfreaks.com/topic/107987-set-results-to-variable/
Share on other sites

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.