-
Posts
837 -
Joined
-
Last visited
Everything posted by samshel
-
[SOLVED] copying data from one row to another
samshel replied to jakebur01's topic in PHP Coding Help
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. -
what function do I use to split a rather large common file?
samshel replied to Iank1968's topic in PHP Coding Help
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. -
[SOLVED] how to put html into a string; problem with quotes
samshel replied to sillysillysilly's topic in PHP Coding Help
$string = " hello y'all this is a \" "; -
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.
-
[SOLVED] how to put html into a string; problem with quotes
samshel replied to sillysillysilly's topic in PHP Coding Help
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 ? -
[SOLVED] how to put html into a string; problem with quotes
samshel replied to sillysillysilly's topic in PHP Coding Help
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? -
[SOLVED] how to put html into a string; problem with quotes
samshel replied to sillysillysilly's topic in PHP Coding Help
addslashes() -
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.
-
ok try to do step 1)
-
change to header('Location: ../main/profile.php?usID='.$usID.'&username='.$username);
-
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..
-
remove the "} else {" line, if u dont have to check for anythign before redirection.
-
$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.
-
cool ! please mark as solved !
-
try url rewriting and .htaccess, google for it
-
else is associated with an "if", where is the "if" ?
-
you will have to take the post id also from the user, which u r not taking now.
-
[SOLVED] How to check if command line php is running or not?
samshel replied to freephoneid's topic in PHP Coding Help
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. -
[SOLVED] How to check if command line php is running or not?
samshel replied to freephoneid's topic in PHP Coding Help
thorpe meant use a combination of exec and this command like exec("ps aux | grep 'abc.php'", $return); print_r($return); -
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
-
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.
-
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 !
-
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.