Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.