sql table erroring out


#1

im trying to display the sql table but i get these warnings please help im sorta on a deadline :o :o :o
and how do you tell it to pull from table

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/u160665993/public_html/argylewallet/testpanel.php on line 485
 
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/u160665993/public_html/argylewallet/testpanel.php on line 486
 
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/u160665993/public_html/argylewallet/testpanel.php on line 487
 
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/u160665993/public_html/argylewallet/testpanel.php on line 488
 
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/u160665993/public_html/argylewallet/testpanel.php on line 489
 
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/u160665993/public_html/argylewallet/testpanel.php on line 490
 
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/u160665993/public_html/argylewallet/testpanel.php on line 491

[php]<?php
mysql_connect(“sql server”,“u160665993_adds”,“addsadds”) or die(mysql_error());
mysql_select_db(“u160665993_adds”);
$query=“SELECT * FROM data”;
$result=mysql_query($query);

$i=0;
while ($i < 1)
{

$companyname=mysql_result($result,$i,“companyname”);
$posteddate=mysql_result($result,$i,“posteddate”);
$phone=mysql_result($result,$i,“phone”);
$web=mysql_result($result,$i,“web”);
$expirydate=mysql_result($result,$i,“expirydate”);
$categories=mysql_result($result,$i,“categories”);
$classified=mysql_result($result,$i,“classified”);

print("<em style=“font-weight: normal;”><span style=“font-size: 12pt;”>Categorie is $classified");
echo "<table border= “4” cellpadding=“2"cellspacing=“1” width=“100%”>”;
echo “

Company Name : $companyname ”;
echo “ Posted Date : $posteddate ”;
echo “ Phone : $phone ”;
echo “ Website : $web ”;
echo “ Expiry Date : $expirydate ”;
echo “ Categorie : $categories ”;
echo “ Classified : $classified ”;
echo " Service Rating : Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/u160665993/public_html/argylewallet/testpanel.php on line 491 "; echo "";

$i++;
}
?> [/php]


#2

Not sure what you need, but, try this…

[php]

<?php mysql_connect("sql server","u160665993_adds","addsadds") or die(mysql_error()); mysql_select_db("u160665993_adds"); $query="SELECT * FROM data"; $result=mysql_query($query); echo "Categorie is $classified"; echo ""; while( $row = mysql_fetch_array($result) ) { $companyname=$row["companyname"]; $posteddate=$row["posteddate"]; $phone=$row["phone"]; $web=$row["web"]; $expirydate=$row"expirydate"]; $categories=$row["categories"]; $classified=$row["classified"]; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
Company Name : $companyname
Posted Date : $posteddate
Phone : $phone
Website : $web
Expiry Date : $expirydate
Categorie : $categories
Classified : $classified
Service Rating : ???
"; ?>

[/php]
Of course, I am assuming that you want all of the data returned to be displayed…
Also, there was no variable showing for “Service Rating”, so you have to fix that…
Good luck…


#3

with your code i recieve back Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/u160665993/public_html/argylewallet/testpanel.php on line 480


#4

Well, I typed it quickly, what line is 480??? Perhaps I can tell you the fix…


#5

here its the code 475.[php]<?php476.mysql_connect("mysql.hostchick.co.uk","u160665993_adds","addsadds") or die(mysql_error());477.mysql_select_db("u160665993_adds");478.$query="argylebia";479.$result=mysql_query($query);480.echo "Categorie is $classified";echo "

";while( $row = mysql_fetch_array($result) ) { $companyname=$row["companyname"]; $posteddate=$row["posteddate"]; $phone=$row["phone"]; $web=$row["web"]; $expirydate=$row"expirydate"]; $categories=$row["categories"]; $classified=$row["classified"]; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; }echo "
Company Name : $companyname
Posted Date : $posteddate
Phone : $phone
Website : $web
Expiry Date : $expirydate
Categorie : $categories
Classified : $classified
Service Rating : ???
";?> [/php]

#6

Hmmm, did see one space missing and one variable change that might help… Not sure!

So, try this, change these:

echo “<em style=“font-weight: normal;”><span style=“font-size: 12pt;”>Categorie is $classified”;
echo "<table border= “4” cellpadding=“2"cellspacing=“1” width=“100%”>”;

echo "<em style=\"font-weight: normal;\"><span style=\"font-size: 12pt;\">Categorie is " . $classified . "</span></em>";
echo "<table border= \"4\" cellpadding=\"2\" cellspacing=\"1\" width=\"100%\">";

See if that fixes it…