PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
So- I'm trying to take data from a form and insert it into a few different tables. I'm also trying to use the auto incremented IDs that those inserts are generating to then insert into another table. Here's the code I'm using so far that isn't working.
I tried echoing out the variables $projectid and $keywordid and I get nothing. The data for the first 2 inserts is going in the database just fine, so I'm wondering where my error is...
can anybody help me out?
Thanks so much!
Last edited by Benjamin on Tue Jun 23, 2009 11:36 pm, edited 1 time in total.
Reason:Changed code type from text to php.
Hey there, forgive me- I'm really a beginner. I'm not sure how the different things you mentioned impact my code.... how would I use $conn for everything?
jballou wrote:Hey there, forgive me- I'm really a beginner. I'm not sure how the different things you mentioned impact my code.... how would I use $conn for everything?
Well I don't know what extension that $conn uses internally, but the other two calls are to separate extensions mysqli_error() is the mysqli extension, where mysql_insert_id() is the mysql extension. You can't mix them. They are totally different libraries.
By using $conn I mean, either using $conn->error() and $conn->insertId() if they are available -- or writing them for your use. Then you are sure that all calls are to the same extension.