Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Insert a value from an array into MySQL


brandozz - 3:50 pm on Jun 24, 2012 (gmt 0)


Hi all,

Wondering if anybody can help me out with something. I'm pulling a value from a table using the following query:


$q = "select MAX(id) from rma";
$result = mysql_query($q);
$data = mysql_fetch_array($result);
echo $data[0];


I have this query working, it pulls that largest id number from the table called rma. Now I want to take the value stored in $data and insert it into a different table. Any thoughts on how this can be accomplished?

Simply inserting the variable $data into my insert statement doesn't work.


Thread source:: http://www.webmasterworld.com/php/4468928.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com