View Full Version : Scoured the Internet... Unable to jump to row MySQL result index

08-31-2011, 07:11 PM
I cannnot find a good answer for me on this subject. I'm looping through a dynamic sql query to get different results from the same two columns. Eventually I want to have dynamic text areas. This worked before I tried to do it dynamically.. I check dynamic checkboxes on one page, pass the values over to the next page, and then try to loop through to get the code, code descr from the db. The link to the site is..

The code on the page receiving the posted data is:


$count = 3;
while ($i < $count){
echo $i;
$Code= $_POST[$i];
echo $Code;

$dbconnection = mysql_connect(host, database, password) or die("Died!");
echo "Connected to MySQL". '<br />';
mysql_select_db("dbwholedoc",$dbconnection) or die("Died!");
echo "Connected to Database". '<br />';

if ($Code <>''){

$sql = ("SELECT Code, CodeDescr FROM VisitCodes where Code = '".$Code."'");

echo "Query: " . $sql;



echo $code0;
echo $codedescr0;
/*result not coming through query for code and codedescr... query not executing correctly*/

echo $num;




Thanks in advance!

08-31-2011, 07:50 PM
Check out the link in my signature (the one about [php] tags)

08-31-2011, 09:59 PM
All the code posted above is PHP. It is a block straight off the page. thx.