<?php
$sqls = mysql_query("SELECT weight FROM $usertablestats")
or die ("Query failed: " . mysql_error() . " Actual query: " . $query);
$ct = mysql_query ("COUNT * '$sqls'");
if ($ct > 0) {
while ($row = mysql_fetch_array($sqls));{
$weight = $row["weight"];
echo "C" . $weight;
}}
else {
echo "No stats found";
}
?>
This outputs "No stats found" even though I have data in the table.
<?php
$sqls = mysql_query("SELECT weight FROM $usertablestats")
or die ("Query failed: " . mysql_error() . " Actual query: " . $query);
$ct = mysql_num_rows($sqls);
if ($ct > 0) {
while ($row = mysql_fetch_array($sqls));{
$weight = $row["weight"];
echo "C" . $weight;
}}
else {
echo "No stats found";
}
?>
This returns nothing. No echo at all.
I have checked to see if it is accessing by just using:
<?php
$sqls = mysql_query("SELECT weight FROM $usertablestats")
or die ("Query failed: " . mysql_error() . " Actual query: " . $query);
$row = mysql_fetch_array($sqls);
echo $row;
?>
And it does return the first entry.