Jump to content

Snart

Members
  • Posts

    101
  • Joined

  • Last visited

    Never

Everything posted by Snart

  1. What if you add COUNT(cd_name) to the SELECT part?
  2. Can you show us the contents of the table and the result you see on the screen?
  3. The parent in your database table for the trance options is 2 but it should be 8
  4. Are you sure that each of these included PHP files actually produces content? If you include only in the first DIV and leave the rest empty, do you get results for each PHP page if you include them in turn?
  5. AFAIK, that doesn't strip HTML tags, it just escapes some characters. However, htmlspecialchars() does replace < and > by < and > htmlspecialchars() is actually meant to make sure HTML code is NOT displayed as HTML.
  6. You're not linking your javascript page (bbcode.js) to the page that contains the form, so it doesn't know bbcode(). In fact, you're not using any kind of basic HTML at all (<HTML><HEAD><TITLE>...) Try adding this to your form page: <html> <head> <title>Calendar</title> <script language='javascript' src='bbcode.js'></script> </head> <body> Replace this text by your form </body> </html>
  7. I'm assuming you're using POST as the method for your form, and you call the same page to process it. So (I will be foregoing the usual mysql injection checks and so on to concentrate on the real issue): <?php $error = ''; if(array_key_exists('phoneNumber', $_POST)) { if(!preg_match('/^[0-9]{3}-[0-9]{3}-[0-9]{3}$/', $_POST['phoneNumber'])) { $error = 'Wrong phone number!'; } } ?> <label for"phoneNumber">Phone Number: <?php echo $error; ?> </label> <input type="text" name="phoneNumber" />
  8. If this HTML is not shown properly, most likely the tags were stripped or the <> were replaced with their < > counterparts. I'm assuming you're retrieving the code from the database and then echo it to the screen. Could you copy/paste the echoed code here (and copy it from the "view source code" screen in your browser so we can see all special characters)?
  9. Yeah, I'm beginning to think this is the only way to do this. Are there any possible queries you can think of that don't start with the relevant keyword (select, insert, show, delete, ...)?
  10. Actually, it is perfectly normal. You have "$row['memcount'] < 20" twice in your code. The first one determines if the player's team should be changed, the second one updates the counter. So, for example: The count is 19. A player wants to choose this team. count < 20: ok, player's team is changed. count < 20: ok, increase counter from 19 to 20. Next player tries: count < 20: not ok it is 20 now, maximum number of players reached. This works because the counter is increased only after you change the team.
  11. Right after you've built up $sql: $sql="INSERT INTO members (email) VALUES ('{$_POST['email']}')"; // notice the use of { and }, doing that will allow the array index to display without error. echo $sql;
  12. You're not linking both tables. There should be something like the following in your WHERE clause: listings_urls.id = listings.id
  13. Could you place an echo of $sql after you've built up the query and before you execute it?
  14. How about: update teams SET memcount = memcount + 1 WHERE id='$team'
  15. $_POST doesn't exist. $_POST['email'] or $_POST["email"] do.
  16. Snart

    help?

    CURDATE() + 1 should add a day.
  17. The first one in the list seems like one http://www.zimmertech.com/tutorials/php/25/comment-form-script-tutorial.php
  18. Most likely, the query is for some reason always returning a result even if the WHERE clause is not met, so (mysql_num_rows($q2) > 0) is always true. However, because the WHERE clause was not met, there is no 'maxbid' in the result and $r2['maxbid'] amounts to nothing. Try the following to test this: echo $r2['maxbid'].' - Test';
  19. Ehm, I just fed Google: php comment box tutorial and got a ton of results.
  20. $result = mysql_query("SELECT `username` FROM `users` where `ip` = '".$whatever."';") if(mysql_num_rows($result) > 1) { echo 'Someone has been naughty.'; }
  21. At first sight, I'd say that your username and password aren't valid, so the following code is executed which stores a variable but doesn't display anything: }else{ // If not match. $message="--- Incorrect Username or Password ---"; } On a sidenote, be careful how you handle the POST variables. Mysql injection could be a serious security issue here.
  22. http://www.phpclasses.org/browse/package/4987.html Not sure if it works properly.
  23. I used xampp in the past, currently I use wampserver. But the issue is not the creation of the tables (which has to be done via script, not phpmyadmin and such) but the fact that a "CREATE TABLE" statement generates an error when I use mysqli_num_rows(). I need a way to either test if mysqli_num_rows will work properly on the query, or determine if the query that is being launched is a CREATE statement or SELECT statement or something else.
  24. Hi When I try to use mysqli_num_rows on a "CREATE TABLE" statement, it returns me the error "mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in ...". This is because the CREATE statement doesn't return a number of rows like a SELECT statement would. Is there a clean way to deal with this error? Either by somehow finding out which "type" of query I'm dealing with (a substring extracting the first word of the query could do the trick, but it doesn't feel right) or by error-free testing if mysqli_num_rows is applicable (adding a @ before the function would also do the trick but is, again, not a really clean way). BTW, I'm using a home-brewn general-purpose query function which launches queries for me and which automatically retrieves results. So it's not a matter of calling mysqli_num_rows only when I launch a SELECT statement, my function doesn't know which type of query is used and I'm not too fond of having to pass the type each time as an argument. Cheers Snart
  25. Seems like you're not getting authenticated on the MySQL server. Make sure your login and password are correct.
×
×
  • 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.