sql troubles.

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

sql troubles.

Post by psychotomus »

whats wrong with this. it doesnt display no data even though there is data.

Code: Select all

<?php
$member_id = $_SESSION['userid'];
include 'config.php';
$result = mysql_query( "SELECT * FROM po2_files WHERE member_id='$member_id'" ) or die("Create table Error: ".mysql_error());//

while( $row = mysql_fetch_array($result))
{	//Store Record Of Data in $row
print '<tr> 
         <td valign="top"><div align="center"><a href="view_file.php?file='. $row['file_name']. '"></div></td>
         <td valign="top"><div align="center"><strong><a href="my_files_delete.php?file='. $row['file_name']. '"></strong></div></td>
                    </tr>';
}
?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It would suggest that no records matched $member_id
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

Post by psychotomus »

$member_id does have a value and records do exist when looking in my sql cpanel.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

what does mysql_num_rows() say?
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

Post by psychotomus »

was html problems not php.
Post Reply