Newbie Help with array from mySQL query
Posted: Tue Aug 19, 2014 10:45 am
Hi, I am trying to make a multi dimensional array with the results of a query and then $_post the array to another page. I am obviously missing something in creating my array. Dumb question, but can someone take a quick look and let me know how to fix this ?
Thanks
Thanks
Code: Select all
$strSQL = "SELECT * FROM `t_Questions` WHERE qu_Survey_ID = '".$survey_ID."' ORDER BY RAND() LIMIT 5";
$rs = mysql_query($strSQL);
$i=0;
//Set up global entry items
$ID="";
$Survey_num=$survey_ID;
$Dealer_ID=1002;
date_default_timezone_set('America/Toronto');
$Date=date('Y-m-d H:m:s');
//Now Loop through entries to get rest of array elements
while ($row= mysql_fetch_array($rs))
{
$count=$i+1;
$surQ = $row['qu_text'];
$surQ_number = trim($row['qu_Survey_Q_number']);
$surMinLabel = $row['qu_bottom_label'];
$surMaxLabel = $row['qu_top_label'];
$showScale = $row['qu_scale_visible'];
$showScale = trim($showScale);
$questionGroup=$row['q_Q_Group'];
$DataToPost=array($Dealer_ID,$Survey_num,$surQ_number,"GUID",$surQ,$questionGroup,$showScale,$surMaxLabel);
$i++;
}