Jump to content

Help with my PHP+MYSQL script


winmastergames

Recommended Posts

Well sorry to say but i need a bit more help a deleted the idea of my last script and made a new one i just need 1 thing fixed in it though it comes up with this error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\swd\ser1\fetch\index.php on line 24

Here is my Code:

<html>
<head>
</head>
Your Website ID is: 
<?php 
//show website ID, website copyright winmastergames 2008
echo $_GET["website"]; 
?>
<br>
<?php
//Show Website, website copyright winmastergames 2008
// connect to db
// select db
$db_host = "localhost";
$db_username = "root";
$db_password = "com12345";
$db_name = "swd";
$websiteid = $_GET["website"];
$conn = mysql_connect($db_host, $db_username, $db_password) or die(mysql_error());
mysql_select_db($db_name, $conn) or die(mysql_error());

$myquery = mysql_query("select * from ($websiteid)");

while($r=mysql_fetch_array($myquery)) {

$rowname=$r["name"]; // put your field's name is where "their_website" is
$rowurl=$r["url"]; // put your field's name is where "their_link" is
$rowdescription=$r["description"]; // put your field's name is where "their_description" is

echo "$rowname | ";
echo "<a href=\"$rowurl\">$rowurl</a> | ";
echo "$rowdescription<br>";

}
?>

</html>

I just cant figure it out??

Please help :)

 

Link to comment
https://forums.phpfreaks.com/topic/89426-help-with-my-phpmysql-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.