Jump to content

SNN

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

SNN's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Very true, but this is for a custom forum software, so extra functions for debugging mode will be good. Thanks everyone. Billy
  2. <form action="<?php echo $SCRIPT_NAME ?>" method="post"> Needs to be: <form action="<?php echo $SCRIPT_NAME; ?>" method="post"> Remember, you must always have a semicolon for things like that. [edit below](Fixed code) <?php session_start(); require("config.php"); $db = mysql_connect($dbhost, $dbuser, $dbpassword); mysql_select_db($dbdatabase, $db); if(isset($_SESSION['USERNAME']) == FALSE) { header("Location: " . $config_basedir); if($_POST['submit']) { $sql = "INSERT INTO categories(cat) VALUES('" . $_POST['cat'] . "');"; mysql_query($sql); header("Location: " . $config_basedir . " viewcat.php"); } else { require("header.php"); ?> <form action="<?php echo $SCRIPT_NAME; ?>" method="post"> <table> <tr> <td>category</td> <td><input type="text" name="cat"></td> </tr> <tr> <td></td> <td><input type="submit" name="submit" value="add entry"></td> </tr> </table> </form> <?php } require("footer.php"); ?>
  3. Ah, my friend suggested this as well, but by just adding $qc++; at the end of each mysql_query. I thought I saw a PHP function to do this before but this will work just as well (Should work from the looks of it.) Thanks!
  4. I am trying to find the function for PHP where you can get the number of mysql queries and print them on a webpage. I know this is possible, I've seen this on a few forums...how can I do this? "Page generated in 2.29798 seconds with 16 queries" Thanks, Billy
  5. Hmm, let me try.... Well now it doesn't show anything. Seems that it can't get the row or something.... *shrug* Hey, I just figured it out... I wasn't using the while function like I was using... not used to it since my friend showed me how Thanks for trying to help, I just forgot about what I used in the project to use the script
  6. This is what I had above the if statement: $sql = "SELECT *"; $sql .= "FROM `threads`"; $sql .= "WHERE `id` = 'tid'"; or something like that...I don't remember if I have it as tid or id. EDIT: This is exactly what I have, it shows only a small bar on the page (?x=1) when it's supposed to show the topic name, poster, and post. $sql = "SELECT *"; $sql .= "FROM `threads`"; $sql .= "WHERE `id` = 'id'"; if($x == $id) { $sql = "SELECT *"; $sql .= "FROM `threads`"; echo('<table width="95%" class="tborder" align=center cellpadding="6" cellspacing="1"> <tr><td class="tcat">'.$row['name'].' </td></tr><tr><td class="alt1">'.$row['post'].'</td></tr></table>'); }
  7. I've been changing it around alot where it eventually came to ?x=tid (just to see if it made a diffrence, I don't know what to expect with PHP), it was originally ?x=viewtopic&x=tid And really it is going to just be a private forum software, just for a few friends and I to use, that's why the code is sort of 'messy/inefficent' lol
  8. I have said before that I am making a forum software, my friends and I just started today and got excellent performance on this, MySQL is running fine with it, but the only thing is I can't make it like the popular forums, where it's like ?x=viewtopic&u='.$row['id'].' in if(), does anyone see a problem with this code? if($x == $row['id']) { $sql = "SELECT *"; $sql .= "FROM `threads`"; echo('<table width="95%" class="tborder" align=center cellpadding="6" cellspacing="1"> <tr><td class="tcat">'.$row['name'].' </td></tr><tr><td class="alt1">'.$row['post'].'</td></tr></table>'); } It works fine on just a single page with... if ($x == "news") { $sql = "SELECT *"; $sql .= "FROM `threads`"; $thread = mysql_query($sql); if(!$thread) { die(mysql_error()); } print '<table align="center" width="95%" class="alt1" cellspacing="1" cellpadding="6"><tr><td class="tcat" colspan="6"> IRC News</td></tr><tr><th>#</th><th>Thread Name/Post</th><th>Created by</th></tr>'; While($row = mysql_fetch_assoc($thread)) { print "<tr><td>".$row['id']."</td><td><B>".$row['name']."</B><blockquote>".$row['post']."</blockquote> </td><td><a href='?x=viewprofile&u=".$row['userid']."'>".$row['createdby']."</a></td></tr>"; } echo '</table>'; } Any suggestions? Thanks, SNN EDIT: Sorry if this is in the wrong forum, also I know there's a simple answer to this, I just don't know what...too frusterated...
  9. That's weird, that's the exact type of form I set up. :-\ I may just convert it over to a PHP and MySQL system, that would work a LOT better, I bet... especially for the posting system I am adding onto it. I can do the MySQL coding, thanks for the help
  10. The script uses sessions, it was working before I added in more users/passes then it just started falling apart. It only uses $_POST to say that they entered a invalid user/pass. I may just have to rewrite the script, because now it's giving me a unexpected $ error, which there is nothing there, so it's just messing up. Good thing it takes like 5 minutes.. I guess I'll post what I get after I rewrite the users section of the script.
  11. I have tried multiple ways of using a session and a form, no luck at all. Can anyone tell me how to properly use the code? 1st time if($_SESSION['user'] == "user" AND $_SESSION['pass'] == "pass") 2nd time if($_SESSION['user'] == "user" && $_SESSION['pass'] == "pass") 3rd time if($_SESSION['user'] == "user") { if($_SESSION['pass'] == "pass") Oh and if this has anything to do with it, I have 4 things running on if/elseif. Thanks for any help
  12. Weird. Well, I found out how to get rid of it, MySQL 4.1.21 If it ever turns up just say try installing a version below, I guess lol.
  13. Rwar..bump I seriously need help with this, or else my data (Being a start off webhost with a few clients) have to start over, including one of the starting-to-be popular forums I ran.
  14. I am running vBulletin and Wayne on vBulletin Community Forums said it was a superuser error. Anyone got a idea what that is? Database error in vBulletin : Invalid SQL: SELECT * FROM datastore WHERE title IN ('','options','bitfields','attachmentcache','forumcache','usergroupcache','stylecache','languagecache','products','pluginlist','cron','profilefield','userstats','birthdaycache','maxloggedin','iconcache','eventcache','mailqueue'); MySQL Error : Got error 1 from storage engine Error Number : 1030 Date : Tuesday, April 17th 2007 @ 08:07:23 PM Script : Referrer : IP Address : 192.168.1.1 Username : Classname : vB_Database Thanks for any help.
  15. I have been struggling to install these two scripts together, the last time I looked in the error logs I got this: How do I make PHP support MySQL fully? I have enabled the extension for MySQL. extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_oci8.dll ;extension=php_openssl.dll ;extension=php_pdo.dll ;extension=php_pdo_firebird.dll ;extension=php_pdo_mssql.dll extension=php_pdo_mysql.dll
×
×
  • 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.