Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. You'll need to post your code here in order for us to identify your problem.
  2. A tutorial on mod_rewrite
  3. Umm, you have forgotten to wrap your query in parenthesis's when you call mysql_query on lines 16 and 25 The correct syntax for using mysql_query is $result = mysql_query('your query here'); Not $result = mysql_query 'your query here';
  4. Just like you have already done with $db variable in your original code. mysql_query($sql, $db) or die('ERROR!<br />Query: '.$sql.'<br />'.mysql_error());
  5. Did you just add that line, then tested your code immediately after? If you noticed I assigned the query to a variable called $sql. You'll need pass this variable to mysql_query() in order for the query to execute.
  6. Sorry, just noticed whats going on with line 8, 7. $character = $_POST['character']; 8. { 9. if(!$user || !$pass || !$character) Have you missed something out there? If not then remove that line.
  7. Remove the ; at the end of line 16
  8. Are you wanting to make changes to an existing record in the table? if so you'll want to run an UPDATE query. INSERT INTO is for creating new records only. $sql = "UPDATE project SET user_id='$name2' WHERE project_id='$name'";
  9. Like what... How do we know how your script is supposed to work. You need to give us more info. What is it you're trying to do. What is your script supposed to do, and what result are you getting etc.
  10. Your site wont center because you're using absolute positioning.
  11. Theres your problem. Your second query is not able find a user_id of 2 within your user_accounts table, thus why $comment_name does not display anything when you echo it.
  12. You said comment_by_id works. However you're selecting a column called comment_by. Are these the same? Add the following echo 'The query: <pre>'.htmlentities($query1).'</pre> returned '. $num_rows . 'rows'; after: $result1=mysql_query($query1); if (!$result) { die(mysql_error()); } $num_rows=mysql_num_rows($result1); To check if your second query is returning any result and that the query is being constructed correctly.
  13. Remove the HTML tags. If you're not going to output anything to the page then there is no need for the HTML. Or move your PHP code before your HTML.
  14. $sql = sprintf("INSERT INTO BASKET (ORDERID, PRODUCTID, PRODUCTNAME, PRICE) VALUES ('%s', '%s', '%s', '%s')", $orderid, $_SESSION['Cart'][0][$y], $_SESSION['Cart'][1][$y], $_SESSION['Cart'][2][$y]);
  15. No that'll be minus 30 seconds. For minutes you could do echo time() - (60 * 30);
  16. I always use / as my directory separator regardless of the OS the script will be running on. However if you're going to use \ then define your paths within single quotes instead, eg include 'path\to\script'; With single quotes escape characters are not parsed.
  17. You cannot use LoadModule directive within an .htaccess file. You should add that line to Apaches configuration file if you have access to it. If you dont you should contact your host and see if they'll enable mod_rewrite for you.
  18. Where does it say md5 not supported? What is the code you're using?
  19. You could do // increment c $c++; // now check if $c needs resetting $c = (isset($arr[$c])) ? $c : 0;
  20. You call session_start(); on all pages that will use sessions ($_SESSION).
  21. You can list more than one column in your ORDER BY clause. eg ... ORDER BY id, age
  22. You made sure you have started Apache (and MySQL) via XAMPP's control panel? You need to start Apache in order for http://localhost to work. As a side note if you have Skype installed this may cause Apache to not function correctly. This is because Apache uses port 80 by default, which also happens to be the same for Skype There is an Option for Skype to use a different port other than 80 or you can disable Skype while you use XAMPP.
  23. You have have an else statement directly after your while loop. You can only use else statements after an if statement.
  24. Where and how is the $userChars variable being set?
  25. The first I would suggest is to make sure you set a valid DOCTYPE (this should be the first line in any HTML document). Without this line you browser will go in quirks mode which can cause unexpected results.
×
×
  • 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.