Jump to content

cpharry

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Everything posted by cpharry

  1. Yes thats what it comes back with. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\myprogram\xampp\htdocs\xampp\testcategories.php on line 18
  2. Same error, same place. Any ideas.
  3. <html> <body> <table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <?php $host="localhost"; // Host name $username="user"; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="forum"; // Table name // Connect to server and select databse. mysql_connect($host, $username, $password)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); $sql="SELECT * FROM forum WHERE ParentID=1"; $result=mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "<td width=\"53%\" align=\"center\" bgcolor=\"#E6E6E6\"> <div align=\"left\"> <a href=\"view_forums.php?id=" . $row['ID'] . "\">" . $row['Name'] . "</a> </div> </td>\n"; } mysql_close(); ?> </tr> </table> </body> </html>
  4. Nope, sorry I still get the same error on the same line. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\myprogram\xampp\htdocs\xampp\testcategories.php on line 18
  5. $sql="SELECT * FROM forum WHERE ParentID='1'"; $result=mysql_query($sql); while($row = mysql_fetch_array($result)){ echo "<td width=\"53%\" align=\"center\" bgcolor=\"#E6E6E6\"> <div align=\"left\"> <a href=\"view_forums.php?id=" . $row['ID'] . "\">" . $row['Name'] . "</a> </div> </td>\n"; } mysql_close();
  6. You need to add an if function which will get the highest value in the users column for posts and then you run the query that adds one to it. Just putting +1 will set it to literally plus 1.
  7. Hi, Whenever I run my script that if being used in development to make a forum I get this message. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\myprogram\xampp\htdocs\xampp\testcategories.php on line 18 What can I do to stop it ?
  8. Hi, How can I code in php (dreamweaver). I need to program something so that it gathers the categories and then it lists the forums underneath it. Has anyone got a tutrial for it ?
×
×
  • 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.