Click here to Skip to main content
14,641,922 members

Not getting response on a table

bmaglar asked:

Open original thread
Doing the query on the database it gets the correct results, but the table is empty. Any suggestion?
<TABLE>

<?php

$userid=$_SESSION['userid'];

$result=mysql_query("SELECT * FROM companies WHERE company='$_GET[company]' and car_moto='$_GET[car_moto]' and packet='$_GET[packet]' and userid='$userid'");
$num=mysql_num_rows($result);

$i=0;

while ($i < $num) {
        $f0=mysql_result($result,$i,"id");
        $f1=mysql_result($result,$i,"company");
        $f2=mysql_result($result,$i,"car_moto");
        $f3=mysql_result($result,$i,"packet");
        $f4=mysql_result($result,$i,"protect");
        $f5=mysql_result($result,$i,"price_protect");
        $f6=mysql_result($result,$i,"clear_protect");

        echo "<tr><td align='center'><span>$f1</span></td><td align='center'><span>$f2</span></td><td align='center'><span>$f3</span></td><td align='center'><span>$f4</span></td><td align='center'><span>$f5</span></td><td align='center'><span>$f6</span></td></tr>";
$i++;

}

?>

</TABLE>
Tags: SQL, HTML, PHP, MySQL

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100