Jump to content

stuckwithcode

Members
  • Posts

    76
  • Joined

  • Last visited

    Never

Everything posted by stuckwithcode

  1. I understand that method but was wondering if you can do it in the one line
  2. no text is just some text that i want to be added to the end of the varaible
  3. why does this not work $name = "john"; mysql_query("UPDATE table SET user = '$name'text WHERE id = '5'"); how can i get the query to insert the variable and the text eg johntext into the table
  4. Is there anyway to work out the age of a session, i.e the time that has elapsed since it was created? Cheers
  5. hello that works well thank you, could you explain it a bit though what does the arrow mean. cheers
  6. Hello, I have many session variables and instead of unsetting them all I want to know if there is some code to remove all current sessions apart from a couple of them. Cheers
  7. I have a script that uploads pictures to a folder. I used mkdir to create this folder and sub folders. Do I need to chmod folders and files, do i need to do this to my other html, php and image files. I am completetly confused who is the owners group etc thanks
  8. when I insert my value i insert $empty = "" and insert that
  9. Hello, I have a mysql table and when I populate it through php i have to insert blank values into fields if not it will not work. How can I put the default value in phpmyadmin to be blank, but not null. I dont understand the null checkbox or the default value option. Please help not phpmyadmin guides found
  10. is this the best way to check if a server is live? <?php $host = "www.google.com"; $fp = fsockopen($host, 80, $errno, $errstr, 10); if($fp) { echo "yes it is"; fclose($fp); } else { echo "no it is not"; } ?> But if you type in a false server eg www.googddfsdfsd.com it returns an error how can i get it to return false and why doesn't it.
  11. I still don't get it, if you look at the code below why does the cookie take a refresh but the variable doesn't then. Could you explain in detail please. <?php session_start(); setcookie("random",1,time()+600000,"/"); echo $_COOKIE['random']; $variable = 1; echo $variable; ?> Thanks
  12. why does the code below not work first time, the value 1 is only echoed after a refresh <?php session_start(); setcookie("random",1,time()+600000,"/"); echo $_COOKIE['random']; ?>
  13. Hello, I understand the code below apart from the \n after the <br />. The br is the line break so what is the \n also doing there. Could someone please explain. wordwrap($text,75,"<br />\n",TRUE); Thanks
  14. The last post I typed was untrue the variable does work but if i have IN(101,110,102) it prints rows 101,102,110 when i want the order to be 101,110,102 any ideas
  15. thanks, why can i not put a variable in IN(), the code below does not work so i just put the variable in after doing the implode e.g. $result = mysql_query("SELECT * FROM tablename WHERE primarykey IN(".implode(",",$randoms).")"); $randomslist = implode(",", $randoms); $result = mysql_query("SELECT * FROM tablename WHERE primarykey IN($randomslist)"); Thanks, Im nearly there
  16. Right this I can do, thanks for all the help. One last thing I under stand the IN() thing but cannot find any guides on it on google etc. can you provide any links, thanks
  17. also could you check your script I cant get it to randomise a table and print it, im also using the table you showed in your example
  18. okay thanks a lot for the help, just to clarify, what do you consider to be a large table? how many rows? THanks
  19. what does the IN mean after primarykey, I half understand the code thanks
  20. if I am using 1&1 as my web host can i just use php mail, how do i know if i need to use smtp authentication. I've been looking at this for a while and am still stuck. I am on 1&1 and want to send email through php is it easy? Thanks
  21. I am trying to randomly order a mysql table and then echo the results. Why is it that everything I read about order by rand() says that It is too slow and not to use it. Can any help explain why or maybe offer up some other suggestions. The table will have a lot of rows eventually Thanks
  22. Hello When sending an email using php mail do i need to type in a username and password of my host somewhere, or is this not needed.
  23. I there an easier way to tell only the country of origin I dont require any other information just the country. Thanks, if not if there a free way
×
×
  • 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.