MyBB Community Forums

Full Version: MySQL Insert Statements
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a portal that requires users to login to access information. I'm working to incorporate MyBB into that portal as well.

Using MySQL insert statements, I'm creating a user account for the portal's user table. Then I return the UserID assigned in the portal, and I've created a MySQL insert statement to add the correct information into the mybb_users table using the portal UserID as the mybb_users uid (I've taken out the autoincrement flag on the uid field in the mybb_users table)

Anyhow, my web page won't run the insert statement for the mybb_users table, but runs fine on any other MySQL query I load.

I can echo the statement to the screen, copy and paste it into my query editor and it works fine.

Both the portal tables and mybb tables are in the same database, so i don't think it's a permissions issue.

On another note, I am able to update the mybb_users table when i change information, just not insert a new record.

Any suggestions please.
From the information provided, I can't really think of anything. Does the insert query return an error? I presume you're using mysql_query directly?
I figured it out. I was using mysql_query and the page wasn't showing any errors. I took another look at the table layout and all fields had the not null flag set. Once I took the flag off each field it started inserting correctly.

I should have caught that earlier.

Thanks.