Page 2 of 5

Posted: Sat Mar 20, 2004 3:45 pm
by bawla
ok i ran the query in phpmyadmin and this is wut i got

Code: Select all

Error

SQL-query :  

SELECT * 
FROM stats
LIMIT 0 , 30 

MySQL said: 


#1146 - Table 'krunk_gtstat.stats' doesn't exist

Posted: Sat Mar 20, 2004 3:48 pm
by markl999
In phpmyadmin, what does 'SHOW TABLES' output ?

Posted: Sat Mar 20, 2004 3:58 pm
by bawla
wut do u mean?

SHOW TABLES?

Posted: Sat Mar 20, 2004 3:59 pm
by coreycollins
In the Query window Type SHOW TABLES just like you did the SELECT statement.

Posted: Sat Mar 20, 2004 4:02 pm
by tim
hi again bawla :D

I think you have the issue confused. database and what is a table (i'm basing this on our talk from last night)

A database is a structure that will hold your tables.
your tables are the rows within (remember, username and percent)

in phpmyadmin, on the left menu theres a, in your case, krunk_something
this is your database, below that theres a list of tables inside that database.

are u sure your matching everything correctly? SHOW tables you will have to insert taht into the window (if you click on the sql link, u can insert it there)

Posted: Sat Mar 20, 2004 4:03 pm
by bawla

Posted: Sat Mar 20, 2004 4:04 pm
by coreycollins
The link doesn't work.

Posted: Sat Mar 20, 2004 4:04 pm
by tim
i get a 404 with that link.

Posted: Sat Mar 20, 2004 4:05 pm
by bawla

Posted: Sat Mar 20, 2004 4:05 pm
by coreycollins
I just poked around your directory listing. The table name is stat according to the SHOW TABLES not stats. If you correct that it should work.

Posted: Sat Mar 20, 2004 4:09 pm
by bawla

Code: Select all

Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 3 in /home/krunk/public_html/gtthing/gtthing3.php on line 25
Username: 

Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 3 in /home/krunk/public_html/gtthing/gtthing3.php on line 29
Percentage:

Posted: Sat Mar 20, 2004 4:11 pm
by bawla
i guess, that that means theres nothing in the rows

Posted: Sat Mar 20, 2004 4:13 pm
by markl999
What does the below output?

Code: Select all

<?php
$db = mysql_connect('localhost', 'database', 'password') or die(mysql_error());
mysql_select_db('database') or die(mysql_error());
$sql = "SELECT * FROM stat";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result)){
  $row = mysql_fetch_assoc($result);
  echo 'Username: '.$row['username']."<br>\n";
  echo 'Percentage: '.$row['percent']."<br>\n";
} else {
   echo 'No rows found';
}
?>

Posted: Sat Mar 20, 2004 4:16 pm
by bawla
no rows found

Posted: Sat Mar 20, 2004 4:18 pm
by markl999
Then, without sounding too obvious, there are no rows in the table, put some in :)