Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. NO its not the PHP version problem.. that just proves vijayfreaks, is correct. remove that last } and remove the contents of on function at a time, until it, runs look, then re-look over that function
  2. use code tags means use the # button so [code.] my code blar [/code.] without the .'s run it again, you may of ran it while the server was busy uploading or something
  3. add an extra } at the end, whats the error now ?
  4. you need to refer to the key name not the index id.. i think you want this if(count($errorhandler) > 0) { foreach($errorhandler as $theerror) { echo "<li>The ".$theerror['Field']."field".$theerror['Type'].$theerror['Message']."</li>"; } form(); }
  5. depends what you want to do.. that will get the data you need
  6. file-get-contents is a good start
  7. I know it would make a 2D array, thats why i asked, but from the first post
  8. something kinda fun to read Images in the database (FS vs. DBFS) http://www.phpfreaks.com/forums/index.php/topic,156445.0.html
  9. 1. to stop people trying to overload the system with too much data in one go. 2. the server timed out and closed the connection to the SQL server.
  10. You need to pull the data <?php $usertest = mysql_query("SELECT username FROM merchants WHERE username = '" .mysql_real_escape_string($_POST['username']). "'"); $num_rows = mysql_num_rows($usertest); if ($num_rows >0) { echo $_POST['username']. " is already taken. Please select a different username."; } else { //process other code } ?>
  11. shouldn't $errorhandler = array(blar blar be $errorhandler[] = array(blar blar
  12. No their 3 options started above, All do the same thing if you plan to use it alot in the current script then use the third option find the one that you find works best
  13. or try this function truncate($str) { preg_match_all('%^((?:http://)?(?:[-A-Z0-9.]+))/%i', $str, $result, PREG_PATTERN_ORDER); return $result[0]; }
  14. Nope, but close <?php /* Codes not shown */ /* make a request SQL*/ $sql = mysql_query("SELECT * FROM member"); // pulling database info directly using $sql $row = mysql_fetch_assoc($sql); //edit pesky ; //display the data $name = $row['name']; echo $name; /* Codes not shown */ ?>
  15. Erm.. theirs no logic in their to set rnum back to anything its set to go up by one thats it!!
  16. yeah, personally i use {} on a short script but if its a long script i set all the variable at the start, thus doing basically the same.
  17. options are or $name = $_SESSION['name']; $sql = mysql_query("SELECT * FROM member WHERE name='$name' ") or die(mysql_error());
  18. its a bad habit and if you turn on error reporting your see a ton of errors, $_SESSION[the_session] will look for a constant named the_session and will fail to find one, and then will send a notice, but php will then use the_session as the variable.. so to sumup PHP is fixing the error "per say" but its still bad pratice..
  19. nice third options except the $_SESSION[the_session] one which will work but is bad pratice.. as PHP will see the the_session as a constant and your get a warning notice
  20. Erm yes you do! Its a SESSION, not a POST or GET so how would the user do that ????
  21. use either $sql = mysql_query("SELECT * FROM member WHERE name='{$_SESSION['name']}'") or die(mysql_error()); or $sql = mysql_query("SELECT * FROM member WHERE name='".$_SESSION['name']."'") or die(mysql_error());
  22. MySQL Error: Can't get stat or error 13, both mean the file isn't found (or can't access the file) maybe try LOAD DATA LOCAL INFILE
  23. replace if (empty($errors)) with if (count($errors) == 0)
  24. i 100% agree, the reason for the "replacement regex" was just incase, RegEx is designed for complex replacements + other, trim is designed to .. well trim the string lol
  25. replace the ereg_replace with $topic_title = ereg_replace('^[[:space:]]+|[[:space:]]+$', '', $topic_title); to remove the spaces the one you currently have is for tab or space, the one above is for whitespace (both) but GingerRobot is correct trim will work
×
×
  • 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.