View Single Post
ישן 10-06-09, 20:53   # 2
intercooler3819
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Jul 2008
הודעות: 1,056

intercooler3819 לא מחובר  

נקרא למערך ניצן:

PHP קוד:
<?php

$nitsan 
= array(); // lets imagine that this variables hosts our array..

$a true;
for(
$i=0$i<sizeof($nitsan)-&& $a === true;$i++)
    if (
sizeof($nitsan[$i]) != sizeof($nitsan[$i+1]) $a false// sizeof() validation

for ($i=0$a === true && $i sizeof($nitsan["type"]); $i++)
    
mysql_query("INSERT INTO `tbl` VALUES ('{$nitsan["type"][$i]}', '{$nitsan["title"][$i]}', '{$nitsan["order"][$i]}')"); // insertion query


// FAST EDIT: The above code would work in case that the indexes of the array are a series of integers, in other cases it would be better to use:
__________________

Last edited by intercooler3819; 10-06-09 at 21:05..
  Reply With Quote