pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
Why do you want to auto-increment two fields? Wouldn't the first one have the same value as the second one?
-
The function is called stripslashes() not stripeslashes()
-
Take a look at this http://www.hscripts.com/scripts/JavaScript/select-all-checkbox.php
-
I don't understand why it won't work, I don't understand what your trying to say. SQL checks if there are similar nicknames for "test1", but there are none. Then it will be OK to do one. Isn't that what you want?
-
You would ask this question in the general PHP forum...this is a child board of that forum. After you loaded the value of $delim from the DB, did you try printing that variable out to see what it gives you? Maybe it isn't what you expected. Also, for your array, see what it holds by doing this print_r($arr); See if those are the values you expect as well.
-
You can try something like this... <?php //This variable comes from your register form $username = $_POST['username']; $query = "SELECT col FROM users WHERE username LIKE '%$username%'"; $result = mysql_query($query)or die(mysql_error()); if (mysql_num_rows($result) < 1){ //Good, register the username } else { //ERROR: Username is similar to one in the DB } ?>
-
[SOLVED] read / print file to 'x' character??
pocobueno1388 replied to tbare's topic in PHP Coding Help
Use the explode function. Take this for example <?php $str = "125485~dds5f56"; $new_str = explode('~', $str); echo $new_str[0]; //prints "125485" echo $new_str[1]; // prints "dds5f56"; ?> -
You need to use JavaScript http://www.hscripts.com/scripts/JavaScript/select-all-checkbox.php
-
You forgot the '==' on the second one. if ($webtype == 'Cricket' || $webtype == 'Football'){?>
-
Thats supposed to be a commercial? They would have to pay a fortune to air that, lol. I didn't find it very funny...but I guess it was entertaining.
-
Hah, not far from the truth at all.
-
<?php if(isset($_post[check]){ echo "testing1"; exit; //<---- You just needed this } ?> <html> <form action=index.php method=post> <input type=submit name=check value=check> </form> </html>
-
It sounds like you have a mod rewrite on the url...go to your .htaccess file and look for code that looks similar to this - http://www.trap17.com/index.php/php-mod-rewrite-tutorial_t10219.html
-
session doesn't end upon leaving site
pocobueno1388 replied to digitalecartoons's topic in PHP Coding Help
You can set it to expire in your ini file. <?php ini_set ("session.gc_maxlifetime", "3600") ?> -
[SOLVED] Where to put ORDER BY desc when column mixed in w date
pocobueno1388 replied to randalusa's topic in PHP Coding Help
Your still not doing what I told you. Now you putting double quotes...I want you to put back sticks. Also, your not surrounding your variables with quotes. Please just copy and paste this and try it. $query = "SELECT id, user, admin, ip, approve, filename, email, DATE_FORMAT(date, '%m-%e-%y@%H:%i'), orig_name, p_num FROM photo_log WHERE MONTH(date) = '$month' AND YEAR(date) = '$year' ORDER BY `date` DESC"; -
[SOLVED] Where to put ORDER BY desc when column mixed in w date
pocobueno1388 replied to randalusa's topic in PHP Coding Help
Your putting single quotes around "date", you need to put back sticks (or whatever you call them). $query = "SELECT id, user, admin, ip, approve, filename, email, DATE_FORMAT(date, '%m-%e-%y@%H:%i'), orig_name, p_num FROM photo_log WHERE MONTH(date) = '$month' AND YEAR(date) = '$year' ORDER BY `date` DESC"; -
remove the quotes from the 1. mysql_query("UPDATE polls SET `vanswer1`=vanswer1+1 WHERE `pkid`='$pollid'") or die(mysql_error());
-
[SOLVED] Where to put ORDER BY desc when column mixed in w date
pocobueno1388 replied to randalusa's topic in PHP Coding Help
Well, What column does $row[7] refer to in the database? I'm going to assume it's "date". $query = "SELECT id, user, admin, ip, approve, filename, email, DATE_FORMAT(date, '%m-%e-%y@%H:%i'), orig_name, p_num FROM photo_log WHERE MONTH(date) = $month AND YEAR(date) = '$year' ORDER BY `date` DESC"; -
[SOLVED] Need help with looking in $var for certain info
pocobueno1388 replied to mazman13's topic in PHP Coding Help
Could you show your code so it's easier to see what your doing? -
[SOLVED] Need help with looking in $var for certain info
pocobueno1388 replied to mazman13's topic in PHP Coding Help
You just want to count how many Y's are in that column of the database, correct? <?php $query = "SELECT COUNT(column) AS num FROM table WHERE column='Y'"; $result = mysql_query($query)or die(mysql_error()); $row = mysql_fetch_assoc($result); echo "There are $num Y's"; ?> -
[SOLVED] Set the value of a Hidden Field?
pocobueno1388 replied to scooter41's topic in PHP Coding Help
Yes you can do that, you don't need JavaScript. <?php $query = "SELECT prodID FROM table WHERE condition"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)){ echo "<input type='hidden' name='prodID' value='{$row['prodID']}'>"; } ?> That was just a quick example on how to do it. -
[SOLVED] Passing values to constuctor in Object oriented?
pocobueno1388 replied to snowman15's topic in PHP Coding Help
This line echo $bottles->$units."<br />"; Should be echo $bottles->units."<br />"; Also, you should be using the "var" keyword to define your variables within the class. <?php var $units = 0; var $weightPerUnit = 1.0; ?> -
www.killerphp.com has just put up a video tutorial about MySQL and databases. http://www.killerphp.com/videos/14_mysql/mysql-intro-part1.php Just thought I would share that since I just stumbled across it.
-
Try this SELECT * FROM governmentparties WHERE (Treasurer='$UserName' OR PartyLeader='$UserName') AND (Prime='1' And CountryID='1')