|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Imploded resultts?
Ok i have this SQL that inserts two vars into an art_cat table..
PHP Code: $sql2 = mysql_query("INSERT INTO art_cat (sub_cat_id, art_id) VALUES ('$var', '$art_id')"); However, the var '$var' holds the imploded data, e.g 1_2_3_4_5 so when the data is entered into the DB, i get the following art_id sub_cat_id 69 1_2_3_4 _____________________ I would like the infor to be added like this though art_id sub_cat_id 69 1 69 2 69 3 69 4 ______________________ could someone show me how i would need to alter my SQL for this to work. would i need a 'for each' loop according to the $var variable, then for each number, insert the art_id and number. this would make all my other code work correctly. thanks. |
|
#2
|
|||
|
|||
|
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Imploded resultts? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|