Jump to content

love_bug

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

About love_bug

  • Birthday 03/04/1980

Profile Information

  • Gender
    Male

love_bug's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ahh.. thank everyone for the help, especially sasa, his solution works like charm.. thankx
  2. Hi, yea similar to : http://stackoverflow.com/questions/842956/php-foreach-loop-through-multidimensional-array but the solution he provided doesn't apply to my problem i guess.., only thing I want to do is get array of "m_name[] and m_name[]" and insert them in db with loop. here's array output : Array ( [0] => someone [1] => Array ( [email] => someone@gmail.com ) [2] => sometwo [3] => Array ( [email] => sometwo@gmail.com ) [4] => somethree [5] => Array ( [email] => somethree@gmail.com ) )
  3. hi thanks for reply.. yea i thought about that too, but i want to put those values together in db.. while (each $val1, $val2) { $sql = "INSERT INTO table name (name,email)($val1,$val2); } It will be great if i could combine 2 array like below so i can put them in sql db with while loop.. just tell me it cant be done in php lol .. thankx Array ( [0] => $val1, $val2 [1] => $val1, $val2 [2] => $val1, $val2 )
  4. Hi again , I am stuck with simplest problem of array .. i searched all forums and couldn't find similar problem.. Iam collecting array post data "data m_name[]" from a form, but I don't know how to get 2 array variables at the same time, here's what I tried : <form action="" method="post" name="myForm"> <div> <input type="text" name="m_name[]" /> <input type="text" name="m_name[][email]" /> </div> <div> <input type="text" name="m_name[]" /> <input type="text" name="m_name[][email]" /> </div> <div> <input type="text" name="m_name[]" /> <input type="text" name="m_name[][email]" /> </div> <input type="submit" name="button" id="button" value="Submit" /> </form> other page where I want to receive above array <?php if($_POST) { print_r($_POST['m_name']); // Output is : Array ( [0] => someone [1] => Array ( [email] => 3 ) [2] => someone two [3] => Array ( [email] => 4 ) [4] => someone three [5] => Array ( [email] => 5 ) ) while (list ($key,$val) = @each ( $_POST['m_name'])) { echo $val.val2 ???"<br/>"; // here I want to get both value $_POST['m_name'] and $_POST['m_name'] ['email'] since I am putting them in db << } } ?> I want to get both values of $_POST['m_name'], I don't know how to do it or is there another way to do it? thankx in advance!! phpfreaks have been very helpful ..
  5. i meant .. removing the Slash ( / ) at the end.. if you are receiving "No such file or directory" error.. that only comes up when path is wrong. I faced same problem while ago, removing slash at the end worked great for me
  6. wow.. a single mistake lol.. thankx for reply, I am using ez_mysql_warper.. i didn't pay attention to that part "$db->get_row".. just changed it to "$db->get_results(" and worked like charm.. thanks for help.. "==" part isn't that important cos i probably double typed that when I posted. thankx again.
  7. try modifying folder path to "./images/$gender"; ?
  8. If you are storing treasure, wealth, gold information with your project you should worry, but for average website like phpfreaks md5 is more than enough i guess.
  9. Hi guys, I am creating a quiz system for my personal site, I am done with all the quiz questions creating part, but I am stuck with something like... user taking a random sql generated quiz and submitting it.. Here's randomly generated sql quiz, even the answers are in random order: <form method="post"> <b>1. What is color or sky</b> <ol> <li><input name="question_3_answer" type="radio" value="6" /> sky</li> <li><input name="question_3_answer" type="radio" value="8" />blue</li> <-- true <li><input name="question_3_answer" type="radio" value="3" />red</li> </ol> <b>2. What is name of my cat</b> <ol> <li><input name="question_6_answer" type="radio" value="9" />brat</li> <--true <li><input name="question_6_answer" type="radio" value="7" />rat</li> </ol> <b>3. What is name of my pet</b> <ol> <li><input name="question_18_answer" type="radio" value="9" />cat</li> <--true <li><input name="question_18_answer" type="radio" value="7" />dog</li> </ol> </form> Now this is tricky part for me is.. receiving these data in another page.. since it's randomly generated questions, how do I know which question it is? here's example I've tried : $list_all_quiz_questions = $db->get_row("SELECT question_id, its_true_ans_id FROM question_table WHERE quiz_group = 'ef23fsdfers3e' "); $i = 1; foreach ($list_all_quiz_questions as $myquestion) { $answer.$i == $_POST["question_".$myquestion->question_id."_answer"]; //?????????? not working lol ;(( $i++ }
  10. Hi, This is an unusual problem I have.. I have a field named "recipient_userids" where I store ids of users in a comma separated form, sucha as "3323,5543,53,3235,23" Now I want to select records from db, which matches a particular userid in "recipient_userids". such as.. If I want to retrieve a record that has 53 in "recipient_userids" how do I do it? I tried LIKE, IN syntax, but not doing the job. OR is there a way to do it please share.
  11. No such errors for now.. I'll let you know about it.. thanks darkwater..
  12. Wait!!... it worked.. thanks BlueSkyIS.. I can not believe it.. I copied your code and uploaded it into my web server and it worked... (it is still showing error in my computer.. like i least care).. what the hell..!! Thank you so much for your help.. no doubt.. the best php support forum in the world!!
  13. in my web server, host has turned off error reporting.. all i could see is a blank screen. but in local host i am still getting this : Parse error: syntax error, unexpected $end in D:\Web_Projects\link_suggest.php on line 1085
×
×
  • 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.