Jump to content

samshel

Members
  • Posts

    837
  • Joined

  • Last visited

Everything posted by samshel

  1. u want to do it in one query? u can fetch all records u want in PHP, fetch the values and update it with another query.
  2. as far as i understand, splitting files does not have anything to do with server strain. The code is anyways going to be executed if u include them. For splitting it is entirely developers decision whether to split them into 2 or more files and how to do that. you can just put some code in functions and copy the functions in another file, include it and use the functions.
  3. $string = " hello y'all this is a \" ";
  4. u have lot of things to take care there.... $result = mysql_query("SELECT username, gen_id FROM users WHERE username='%s' AND gen_id='%s'"); if ($result == $username && $gen_id) { please read manual for - how to fire mysql query - how to fetch a row from database ( this is different than firing a query) - if loop syntax.
  5. I think that was mal-information on my part. I thought they were doing it with magic quotes, but just magic quotes will be depreciated from what I gathered. so addslashes() is safe to use ?
  6. oops sorry i did not know that ! but why are they depreciating it? it is useful, do they have any alternative/improved function for it?
  7. it does not make any difference if radio button names are variable or static. when HTML is redered u will see them as static for example "gender". on second page, you will need to getch the data again from mysql table and loop through the rows to see if $_POST[$row['var1']] is set. if u r not able to make it send me complete code files, i will take a look.
  8. ok try to do step 1)
  9. change to header('Location: ../main/profile.php?usID='.$usID.'&username='.$username);
  10. store the mapping in database, for what_you_want_to_show vs what_you_want_to_use, while displaying links use what_you_want_to_show, while doing operations, find corresponding what_you_want_to_use and use it..
  11. remove the "} else {" line, if u dont have to check for anythign before redirection.
  12. $updel is in while loop for all ids u r fetching from database. to delete specific post, you will have to take post id from user. 1) Show all posts to user using while loop. Each post will have a radio button. this should be ofcourse inside a form. 2) On submit, put value of radio button in $updel. dont do the while loop. just fire the delete query once with $updel and user_id (BTW where is user id coming from?) in the WHERE clause.
  13. cool ! please mark as solved !
  14. try url rewriting and .htaccess, google for it
  15. else is associated with an "if", where is the "if" ?
  16. you will have to take the post id also from the user, which u r not taking now.
  17. i think getmypid will give u process id of the current script instance that u r running, if u run the same script through another terminal, you will not get pid of that. not sure, but u can confirm. just check if this is what u want.
  18. thorpe meant use a combination of exec and this command like exec("ps aux | grep 'abc.php'", $return); print_r($return);
  19. if u want to search a number in array you can use in_array() if u want to search in database then solution from thorpe will work for u
  20. echo "Inside Config.php..."; class Config { echo something just before your class def...it will tell u whether it is including that file or not.
  21. 1) u r querying user table with user id so there will be only one record, why do u need while loop? 2) if its not user table and somethign else and returns more than one record, then what u r doing is fetching all records, and deleting it one by one. anyways all ur records for that user are going to be deleted, why not just delete them qith one query. while loop not required again !
  22. 1) place your code in blocks. 2) make sure your Config.php is included using some prints in it 3) make sure there is Config class in your Config.php 4) make sure the class is instantiated using print in constructor - although u cannot check this as at the moment, it cannot find the class.
  23. 1) u need $i not $1 2) u need to define $arrCategory also on radio2.php. if you are getting value of $_POST['gender']; properly, that means posting is working properly !
  24. is this complete code ? in radio2.php, where are you defining $arrCategory and $i ?
×
×
  • 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.