inserting into different tables |
6/25/2006 6:29:22 PM |
PHPRunner General questions | |
A
amirgulamali author
Hi, |
|
![]() |
Alexey admin 6/26/2006 |
Amir, if(substr($strFields,-2)==", ") $strFields=substr($strFields,0,strlen($strFields)-2); if(substr($strValues,-2)==", ") $strValues=substr($strValues,0,strlen($strValues)-2); if($values["Singer"]=="'Michael Jackson '") $strSQL = "insert into pop "; $strSQL.=$strFields.") values ".$strValues.")"; |
A
|
amirgulamali author 6/26/2006 |
thanx alexa, |
![]() |
Alexey admin 6/26/2006 |
Amir, <select name="genre"> <option value="rock">Rock</option> <option value="pop">Pop</option> ... </select>
if($_POST["genre"]=="rock") $strSQL = "insert into rock "; else if($_POST["genre"]=="pop") $strSQL = "insert into pop "; ... |
A
|
amirgulamalil 6/26/2006 |
thanx alexa! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=9354&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' /> |
A
|
amirgulamalil 6/26/2006 |
this maybe a dummm question, im still a newbie: |
A
|
amirgulamalil 6/26/2006 |
i think i saw that feature in events! |
A
|
amirgulamali author 6/26/2006 |
in the events: function AfterAdd() { //** Insert a record into another table **** global $conn; $strSQLInsert = "insert into TableName (Field1, Field2) values (Value1, Value2)"; db_exec($strSQLInsert,$conn); }
|
A
|
amirgulamali author 6/26/2006 |
can anybody pls clarify that? |
![]() |
Alexey admin 6/27/2006 |
Amir, |