joebudden Posted January 8, 2007 Share Posted January 8, 2007 Hi guys, I know its really simple and i'm really lame for asking but whats the easiest way to get a mysql integer value into a variable? Link to comment https://forums.phpfreaks.com/topic/33331-getting-a-mysql-value-into-a-variable/ Share on other sites More sharing options...
kykin Posted January 8, 2007 Share Posted January 8, 2007 are there any special operations you want to do to the integer, or do you just want to pull an integer out of your database?[code]$sql = "SELECT * FROM `tablename`";$result = mysql_query($sql) or die(mysql_error());while($row = mysql_fetch_array($result)) { $integer = $row['fieldcontainingintegers']; echo $integer; }[/code]will get an integer out, but this is my super-long-roundabout way to do it... Link to comment https://forums.phpfreaks.com/topic/33331-getting-a-mysql-value-into-a-variable/#findComment-155731 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.