Page is a not externally linkable
jay7981 - 9:37 am on May 5, 2009 (gmt 0)
i have also verified that all fields are correct and matching. and i am getting 1 error: please help connect.php index.php error_reporting(E_ALL); include("connect.php"); $query = "SELECT * FROM join"; if ($num > 0 ) { echo "<b>ID:</b> $id<br>"; ++$i; } } else { echo "The database is empty"; } i even tried to simplify it using [code=php] $query = "SELECT * FROM join"; echo $query; and still no display of results ... puzzuling
i have a php page that should display results of a mysql query inside a table ... however no matter how many entries i have in the table it wont display any results
i have checked and verified the login data several times over it is all correct
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in index.php on line 10
[code=php]
<?php
$hostname='######';
$user='######';
$pass='######';
$dbase='######';
$connection = mysql_connect("$hostname" , "$user" , "$pass")
or die ("Can't connect to MySQL");
$db = mysql_select_db($dbase , $connection) or die ("Can't select database.");
?>
[/code]
[code=php]
<?php
ini_set('display_errors', 'On');
$result = mysql_query($query);
$num = mysql_num_rows ($result);
$i=0;
while ($i < $num) {
$id = mysql_result($result,$i,"ID");
$tagid = mysql_result($result,$i,"tagid");
$tsname = mysql_result($result,$i,"tsname");
$boatname = mysql_result($result,$i,"boatname");
$blevel = mysql_result($result,$i,"blevel");
$plevel = mysql_result($result,$i,"plevel");
$ep = mysql_result($result,$i,"ep");
$firstname = mysql_result($result,$i,"firstname");
$lastname = mysql_result($result,$i,"lastname");
$country = mysql_result($result,$i,"country");
$email = mysql_result($result,$i,"email");
$age = mysql_result($result,$i,"age");
$guild = mysql_result($result,$i,"guild");
$otherboats = mysql_result($result,$i,"otherboats");
$comments = mysql_result($result,$i,"comments");
$ip = mysql_result($result,$i,"ip");
$rank = mysql_result($result,$i,"rank");
echo "<b>Boat ID:</b> $tagid<br>";
echo "<b>TS Name:</b> $tsname<br>";
echo "<b>Boat Name:</b> $boatname<br>";
echo "<b>Boat Level:</b> $blevel<br>";
echo "<b>Pirate Level:</b> $plevel<br>";
echo "<b>EP:</b> $ep<br>";
echo "<b>First Name:</b> $firstname<br>";
echo "<b>Last Name:</b> $lastname<br>";
echo "<b>Country:</b> $country<br>";
echo "<b>Email:</b> $email<br>";
echo "<b>Age:</b> $age<br>";
echo "<b>Guild:</b> $guild<br>";
echo "<b>Other Boats:</b> $otherboats<br>";
echo "<b>Comments:</b> $comments<br>";
echo "<b>IP:</b> $ip<br>";
echo "<b>Rank:</b> $rank<br>";
echo "<a href=\"update.php?id=$id\">Update</a> - <a href=\"delete.php?id=$id\">Delete</a>";
echo "<br><br>";
mysql_close();
?>
<br>
<a href="add.php">Add entry</a>
[/code]
<?php
include("connect.php");
$result = mysql_query($query);
$num = mysql_num_rows ($result);
echo $result;
mysql_close();
?>
[/code]