Snart
Members-
Posts
101 -
Joined
-
Last visited
Never
Everything posted by Snart
-
[SOLVED] Counting actual rows in addition to GROUP BY?
Snart replied to Edward's topic in MySQL Help
What if you add COUNT(cd_name) to the SELECT part? -
Can you show us the contents of the table and the result you see on the screen?
-
[SOLVED] Need help with missing form values .
Snart replied to larsbrimmer's topic in PHP Coding Help
The parent in your database table for the trance options is 2 but it should be 8 -
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?
-
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.
-
I'm really desparate or really stupid - please help
Snart replied to kevinritt's topic in PHP Coding Help
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> -
[SOLVED] How do I validate a number field in a form?
Snart replied to iconicCreator's topic in PHP Coding Help
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" /> -
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)?
-
[SOLVED] mysqli_num_rows on queries which don't return a number
Snart replied to Snart's topic in MySQL Help
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, ...)? -
[SOLVED] adding and subtracting a number from the mysql
Snart replied to kendallkamikaze's topic in PHP Coding Help
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. -
Inserting from form to database(I need help please.)
Snart replied to madjack87's topic in PHP Coding Help
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; -
While() is display 30 of the same items..i only need it to display once
Snart replied to jeger003's topic in PHP Coding Help
You're not linking both tables. There should be something like the following in your WHERE clause: listings_urls.id = listings.id -
Inserting from form to database(I need help please.)
Snart replied to madjack87's topic in PHP Coding Help
Could you place an echo of $sql after you've built up the query and before you execute it? -
[SOLVED] adding and subtracting a number from the mysql
Snart replied to kendallkamikaze's topic in PHP Coding Help
How about: update teams SET memcount = memcount + 1 WHERE id='$team' -
Inserting from form to database(I need help please.)
Snart replied to madjack87's topic in PHP Coding Help
$_POST doesn't exist. $_POST['email'] or $_POST["email"] do. -
The first one in the list seems like one http://www.zimmertech.com/tutorials/php/25/comment-form-script-tutorial.php
-
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';
-
Ehm, I just fed Google: php comment box tutorial and got a ton of results.
-
$result = mysql_query("SELECT `username` FROM `users` where `ip` = '".$whatever."';") if(mysql_num_rows($result) > 1) { echo 'Someone has been naughty.'; }
-
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.
-
http://www.phpclasses.org/browse/package/4987.html Not sure if it works properly.
-
[SOLVED] mysqli_num_rows on queries which don't return a number
Snart replied to Snart's topic in MySQL Help
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. -
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
-
I am getting the following error in the php easy calendar...
Snart replied to jameswebster's topic in MySQL Help
Seems like you're not getting authenticated on the MySQL server. Make sure your login and password are correct.