Wolphie
-
Posts
682 -
Joined
-
Last visited
Never
Posts posted by Wolphie
-
-
Post your code please..
or you could just use $
-
Post your form code too
-
Post your entire code then, rather than complaining about it.
-
From what I can understand, I would suggest something like the following..
<?php $query = "SELECT COUNT(*) as Num FROM `table` WHERE `billing_id` = '$billing_id'"; $result = mysql_query($query) or trigger_error(mysql_error()); for($a = 0; $a < $result['Num']; $a++) print $billing_id . '-' . $a; ?>
-
Everything would be fine, because when you click the submit button, the data will be submitted regardless of whether you use an event handler or not. It doesn't matter, if you remove the onclick event handler, your form will still be submitted.
This works *perfectly* fine for me:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <input type="text" name="name" /> <input type="image" src="http://localhost/MAMP/images/welogo.gif" name="submit" /> </form> <?php if(isset($_POST['submit'])) { print $_POST['name']; } ?>
-
The solution given by dannyb785 doesn't work!!!
What *exactly* doesn't work? Is there anything indicating where the problem is? What's wrong? Please be more clearer.
If you're using Firefox, download the Firebug add-on, it will help you debug and determine the problem.
Why are you adding a submit method to a submit button/image anyway? And I very much doubt that your first one worked, seeing as the form would submit regardless.
-
Why not just select the username in the same query? :S
And also, it's mysql_query() not Mysql_query()
P.S. could you mark your other topic as solved before creating another related question.
-
SELECT `userid`, MAX(`vote_count`) FROM `user_users`
I think you need to display the structure of the database. All votes should be placed at a different table, then check the number of occurences there from the list of users from the users table.
This would makes things inefficient for a simple polling system. A seperate table would only be required if you wanted to record information about the user that voted, e.g. userid, date/time they voted, what they voted for etc.. or if you wanted to display 'pretty' percentage bar images etc.. for BOTH answers.
-
I personally prefer the O'Reilly books, they tend to be very in-depth and detailed with their examples, explanations and definitions. However, php.net is by far the best learning resource in my honest opinion.
-
If I were you, I'd create an additional column on the user_users table, and name it vote_count.
Everytime the user gets a vote, you will update the value in the database and increment it by 1.
Then to check the user with the most votes
<?php // db connection info $query = "SELECT MAX(`vote_count`) FROM `user_users`"; $result = mysql_query($query) or trigger_error(mysql_error()); ?>
-
You should be able to add the display: inline; CSS property to each of the tables.
-
I'd prefer to use the onsubmit(); event handler.
-
Array keys are defined like so:
<?php $my_array = array(); $my_array['name'] = 'Wolphie'; $my_array['age'] = '19'; ?>
-
You should use mysql_real_escape_string() with any query you use that includes POST/GET variables. It helps prevent SQL injections by escaping data.
-
Oh, you don't have to use sprintf(), I just use it because I think it cleans up long queries.
-
There is an Ajax specific forum on this board.
-
It should be:
$query = sprintf("SELECT `address` FROM `address_photos` WHERE `mc_name` = '%s' AND `batch_code` = '%s' AND `time` = '%s'", mysql_real_escape_string($mc_name), mysql_real_escape_string($batch_code), mysql_real_escape_string($time) ); $result = mysql_query($query) or trigger_error(mysql_error());
-
It depends which OS your server is. If it's unix based your path should look similar to
/home/domain.com/www
/home/username/www
-
Personally I really like Yahoo!'s RTE from the YUI. http://developer.yahoo.com/yui/editor/
-
You will need to use socket in PHP to acheive this. Although, I don't see why you wouldn't just use a shell script.
-
It generates a storable representation of a value.
http://uk3.php.net/manual/en/function.serialize.php
Look harder next time. www.php.net
-
You should really use google. I found it on my first search.
phonenumber@tmomail.net
Source: http://www.tech-recipes.com/rx/939/sms_email_cingular_nextel_sprint_tmobile_verizon_virgin
-
That script was relying on register_globals. >_>
Bloody globals!! *raises fist*
-
The problem is the line
echo "<a href='index.php?id=", $id, "'>", $firstname, "</a>";
The formatting is wrong and the quotes are causing the echo statement to end early. Format it like I said and it will work.
As gigas10 pointed out, your formatting is wrong.
Try:
echo '<a href="index.php?id=' . $id . '">' . $firstname . '</a>';
Your quotes were ok by the looks of it, but to concatenate strings, you use a period (full-stop) rather than a comma.
MAX Count im Stumped....
in PHP Coding Help
Posted
Please mark your other topics as solved before creating a new very similar topic. Or, just update older topics.