Jump to content

kosaks17

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kosaks17's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This is the code that i've been using.. Please see below The code works fine but have problems when a field contain quotes, double quotes and commas. Ex : when $addr = "address 1, sample's street." This would cause an error when i try to save it into the database. the query string would give me this. Please see below <?php /* for example the implode results would be ('thomas','17','5 feet','60 kilograms','address 1, sample's street.') */ $query = "INSERT INTO table_name (`name`, `age`, `height`, `weight`, `address`) VALUES ('thomas','17','5 feet','60 kilograms','address 1, sample's street.'); ?> as you can see the string on Values has an error since the bold information has a wrong format.. can someone help me modify the code so that i could save my information whether or not it has a comma, quote and double quote? thanks guys
  2. Im trying to parse this string and put it in the array.. However i dont know how.. 11111<>your mobile<>the receiver<>keyword<>2012-01-15<>12:09:08<>wow "this", is great! I want to remove this sign <> and put the elements on the array.. Also i would not want to loose the quotes and commas Can someone help me? thanks
  3. Thank you so much for your help guys.. I really appreciate it..
  4. Hello This is my array.. Array ( [0] => Array ( [1] => Mike [2] => 17 [3] => camboia [4] => 50kgs [5] => 5 feet ) [1] => Array ( [1] => anna [2] => 21 [3] => peru [4] => 45kgs [5] => 6 feet ) ) Im using foreach loop. This is the code foreach($array as $h => $value) { foreach($value as $elements) { echo $elements; // i want to divide the data into 5 elements then save it to database } echo '<br/><b> --> Break <-- </b>'; } What i want is that to break the data everytime the second loop reach 5 turns then save it to database.. I know how to save it into the database but i dont know how to divide the data on the foreach loop.. Could you help me? Im stuck on this problem.. thanks in advance
  5. Hello to all I have problem a with my foreach loop.. First : Is it possible to rename each element that's been outputted everytime the loop execute? <?php $arr = array(mikel, 17, cambodia, 50kgs, 5 feet, anna, 21, peru, 45kgs, 6 feet); foreach ($arr as &$value) { $value = $value; } ?> What i would like on the result of the foreach loop is name : mikel Age : 17 address : cambodia weight : 50kgs height : 5 feet is this possible? Second : i want to echo the result of the for each loop in every 5 turns. result 1 = mikel, 17, cambodia, 50kgs, 5 feet result 2 = anna, 21, peru, 45kgs, 6 feet Can anyone help me on this? thanks
  6. I think you will have to use javascript on that one to trigger your php script.
  7. Hello guys I have here my array result Array ( [0] => Array ( [0] => 1 [1] => [2] => 123456789 [3] => [4] => 2012-02-02 [5] => 09:12:21 [6] => Test Array ) ) I would like to view this result into a string so that it will remove the unnecessary array elements like brackets etc. Can some tell me how to handle this properly? The result would be : 1 123456789 2012-02-02 09:12:21 thanks
×
×
  • 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.