Jump to content

phpSensei

Members
  • Posts

    2,838
  • Joined

  • Last visited

    Never

Everything posted by phpSensei

  1. I am new here, so solve this one for me too... How do you mark it solved?
  2. THANKYOU again... Now when I click the Forum Name it takes me to the page and displays all the records by pagination, and shows the user what page they are on.
  3. Sorry about that, This is the code without the CSS style and Document Title: <div align="center"> <div align="center"> <table width="57%" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#FFCC99"><div align="left"> <table width="57%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr class="style2"> <td width="89"><div align="center" class="style3 style4"><strong>Home</strong></div></td> <td width="89"><div align="center" class="style6"><a href="user/index.php?mode=signup" class="style6">Register</a></div></td> <td width="89"><div align="center" class="style6">Memberlist</div></td> <td width="89"><div align="center" class="style6">Search</div></td> </tr> </table> </div></td> </tr> </table> <a href="index.php">Metaldog Forums</a> / <?php $id=$_GET['id']; $mysql= "SELECT * FROM forums WHERE id='$id'"; $result1=mysql_query($mysql); $result=mysql_fetch_array($result1); echo $result['forum_name']; ?> <br> <table width="57%" border="0" cellpadding="0" cellspacing="3" id="1"> <tr> <td><div align="center" class="style1 style2"> </div></td> </tr> <tr> <td><?php $id=$_GET['id']; $result=mysql_query("SELECT * FROM forums INNER JOIN forums ON idtop_msg=id WHERE idtop_msg='$id'") or die('Error: ' . mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['subject_msg'] . '<br>' . '<hr> ';} ?></td> </tr> </table> <p> <?php echo $username; ?><br> <br> <span class="style7"><span class="style1">Powered by <a href="index.php">MetalDog.com</a>&#8482; 2007-2008<br> OpenSource Softwares <br> </span><br> </span></p> </div> </div>
  4. I made the forum myself. I removed the php code I wrote just recently, and it seems to be an html issue...or not.
  5. Can someone please tell why this keeps coming up whenever I view one of my forum topics? Error: Not unique table/alias: 'forums' <div align="center"> <div align="center"> <table width="57%" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#FFCC99"><div align="left"> <table width="57%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr class="style2"> <td width="89"><div align="center" class="style3 style4"><strong>Home</strong></div></td> <td width="89"><div align="center" class="style6"><a href="user/index.php?mode=signup" class="style6">Register</a></div></td> <td width="89"><div align="center" class="style6">Memberlist</div></td> <td width="89"><div align="center" class="style6">Search</div></td> </tr> </table> </div></td> </tr> </table> <a href="index.php">Metaldog Forums</a> / <?php $id=$_GET['id']; $mysql= "SELECT * FROM forums WHERE id='$id'"; $result1=mysql_query($mysql); $result=mysql_fetch_array($result1); echo $result['forum_name']; ?> <br> <table width="57%" border="0" cellpadding="0" cellspacing="3" id="1"> <tr> <td><div align="center" class="style1 style2"> </div></td> </tr> <tr> <td><?php $id=$_GET['id']; $result=mysql_query("SELECT * FROM forums INNER JOIN forums ON idtop_msg=id WHERE idtop_msg='$id'") or die('Error: ' . mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['subject_msg'] . '<br>' . '<hr> ';} ?></td> </tr> </table> <p> <?php echo $username; ?><br> <br> <span class="style7"><span class="style1">Powered by <a href="index.php">MetalDog.com</a>&#8482; 2007-2008<br> OpenSource Softwares <br> </span><br> </span></p> </div> </div>
  6. THANKYOU SO MUCH!!!! <?php $id=$_GET['id']; $result=mysql_query("SELECT * FROM message_msg INNER JOIN forums ON idtop_msg=id WHERE idtop_msg='$id'") or die('Error: ' . mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['subject_msg'] . '<br> ';} ?> I know what you ment now, just wasnt clear to me.
  7. This is what I got for line 3: if ((!$_POST["topic_owner"]) ¦¦ (!$_POST["topic_title"]) ||(!$_POST[ "post_text"])) { Correct me if I am wrong. I did this simple one, Try it. $topic_owner=$_POST['topic_owner']; $topic_title=$_POST['topic_title']; $post_text=$_POST['post_text']; if(empty($topic_owner) || empty($topic_title) || empty($post_text)){ header("Location: addtopic.html"); exit; }
  8. $id=$_GET['id']; I got this from the URL.... Link: http://localhost/?mode=viewforum&page=1&id=1
  9. Sorry, didnt quiet gotcha.. Error, query failed You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #4' at line 1
  10. Come on now, let's not teach bad coding practice. You always put quotes around variable definitions for literal values. If you don't it takes it as a constant which causes a notice error which slows down processing time. The quotes around the variable definitions have nothing to do with it. <?php $dbhost= "localhost"; $dbuser= "root"; $dbname= "database"; $connect=mysql_connect($dbhost,$dbuser)or die(mysql_error()); $mysqldb=mysql_select_db($dbname); ?> Let's not try and teach him an inefficient way of coding, and on that note if for some reason his username was ROOT and he had a constant defined as ROOT, well the ROOT constant definition would be assigned to $dbuser. Create a user for the MySQL database and don't use the root with blank password. You should have a user for each database anyway for security purposes. I have used this method for years and never came by one little tiny error regarding Mysql connection. Although you make a good point for the timing, and security issue. I would go with what you said...
  11. I would like to know the best way possible to learn how to create an Advanced text area with smileys, and the text tools. I am low-intermediate level, so I am still learning a few here and there. I am also sorry if this message is in the wrong section, I didn't check if we have a tutorial or request section Thanks frost for letting me know where to post this.
  12. Try this:Do not Use double quotes, and include this file in any page you want. <?php $dbhost= localhost; $dbuser= root; $dbname= database; $connect=mysql_connect($dbhost,$dbuser)or die(mysql_error()); $mysqldb=mysql_select_db($dbname); ?>
  13. I would like to know the best way possible to learn how to create an Advanced text area with smileys, and the text tools. I am low-intermediate level, so I am still learning a few here and there. I am also sorry if this message is in the wrong section, I didn't check if we have a tutorial or request section.
  14. I created that error message, there is something wrong with my query.
  15. I tried what you said, and it seems to have come up with the error 'Error, query failed'. greatly appreciated your help though.
  16. I have setup a forum and all I need is the pagination to display data by pages. I am currently showing the thread names within a topic using this code: <?php $id=$_GET['id']; $data_p=mysql_query("SELECT * FROM message_msg INNER JOIN forums ON idtop_msg='$id'"); $row=mysql_query($data_p)or die('Error, query failed'); while($row = mysql_fetch_array($row)){ echo $row['subject_msg'] . '<br>';} ?> The id is the id of the forum you click on, and idtop_msg holds the id of the forum when you post a message. Everytime I use that code, my data repeats itself three times. I.E: I am posting a message with the title of "Cars", and if I posts this message in the Automobile section it will display my title three times like this; Cars Cars Cars instead of just Cars... I checked my Database to see if the data has been duplicated three times but its fine. It has been stored in my table just once. How do you make it so it shows the Topic Name just once. Any help is greatly appreciated.
×
×
  • 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.