Edward Posted August 6, 2012 Share Posted August 6, 2012 Hope you can help me with this one, i need some advise. I have information that needs to go to mysql, but it needs to go into two tables. I did make two prepared statements in opp which worked out fine but i know this is not a good way, say one goes in successfully, then i get an error on the 2nd i would have had half the data and a messy database. What is the best way to do this, use a stored procedural? Table Joins are only for reading data is that true? Or should I use a transaction with rollback? Link to comment Share on other sites More sharing options...
Edward Posted August 6, 2012 Author Share Posted August 6, 2012 I found this Object-Orientated Style bool mysqli::multi_query ( string $query ) I am putting the info into the database for two tablets of a registration form, i am worried this query is not safe, how should this be done, is there a prepared statement way or is stored procedural a better solution? Link to comment Share on other sites More sharing options...
Larry Posted August 6, 2012 Share Posted August 6, 2012 Yes, JOINs are only for SELECTs. You would use a transaction here, with a rollback. Do not use multi_query(). 1 Link to comment Share on other sites More sharing options...
Edward Posted August 6, 2012 Author Share Posted August 6, 2012 Thanks ill work on that now, thanks for the 5 warning points that looks good under my post count. I noticed there was no error class on the warning points either, the color is still navy and didn't change to red. Link to comment Share on other sites More sharing options...
Recommended Posts