Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Why do you want to auto-increment two fields? Wouldn't the first one have the same value as the second one?
  2. The function is called stripslashes() not stripeslashes()
  3. Take a look at this http://www.hscripts.com/scripts/JavaScript/select-all-checkbox.php
  4. 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?
  5. 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.
  6. 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 } ?>
  7. 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"; ?>
  8. You need to use JavaScript http://www.hscripts.com/scripts/JavaScript/select-all-checkbox.php
  9. You forgot the '==' on the second one. if ($webtype == 'Cricket' || $webtype == 'Football'){?>
  10. 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.
  11. Hah, not far from the truth at all.
  12. <?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>
  13. 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
  14. You can set it to expire in your ini file. <?php ini_set ("session.gc_maxlifetime", "3600") ?>
  15. 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";
  16. 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";
  17. remove the quotes from the 1. mysql_query("UPDATE polls SET `vanswer1`=vanswer1+1 WHERE `pkid`='$pollid'") or die(mysql_error());
  18. 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";
  19. Could you show your code so it's easier to see what your doing?
  20. 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"; ?>
  21. 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.
  22. 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; ?>
  23. 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.
  24. Try this SELECT * FROM governmentparties WHERE (Treasurer='$UserName' OR PartyLeader='$UserName') AND (Prime='1' And CountryID='1')
×
×
  • 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.