Re: looping through a database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Kurth wrote:
Wolf wrote:
Richard Kurth wrote:
Could you please give me an idea where to start looking

while($row=mysql_fetch_array($sql_result)){

if ($row["number"]==1) {
<tr>
<td> File 1</td>
<td>This is the file</td>
<td>Delete</td>
</tr>
}else{
<tr>
<td>File1</td>
<td></td>
<td>Add</td>
</tr>
}

}


What is the query being executed?
<!-- SNIP -->


This is the query being executed
$sql = "SELECT * FROM table WHERE members_id =" . $_SESSION["members_id"];
$sql_result = mysql_query($sql) or die(mysql_error());

That still pretty much tells me nothing.

Does your table named table exist?
Does your script connect or error?
What DOES output to your screen?
Does the schema for your table contain numbers?

What happens when you use $row['number']?

Or are you just hoping for someone to write your code?

As written, your code will fail due to having PHP interspersed with HTML code. As such, you either need to echo or exit out of the PHP areas and then continue.

Wolf


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux