is there a way that i can check to see if a mysql table exists and if not add the table to the database with a session_id as a table name
webguru07
0
Newbie Poster
Recommended Answers
Jump to PostTry this. I haven't tested it but it should do the trick. The key is to use the @ sign on line 2 to prevent the error message from showing up on the clients browser. Also, if you add or die(mysql_error()) to the end of line 2, the script will …
Jump to PostOther suggestion:
CREATE TABLE IF NOT EXISTS `session_id`
Jump to PostIf you're trying to log session variables to a session_id, there may be a more efficient way of doing this. Instead of creating a new table/records/fields, you could have a general 'sessions' table with the following fields:
id (int, autoincrement, PK); session_id(varchar[32]); user_id[int, FK]; session_vars[text]; last_impression[datetime*];
*datetime could …
All 11 Replies
buddylee17
216
Practically a Master Poster
martin5211
37
Posting Whiz in Training
bd5ive
0
Newbie Poster
diafol
kallena
0
Newbie Poster
diafol
toydiaz
0
Light Poster
toydiaz
0
Light Poster
sandeepji1
0
Newbie Poster
quantik
0
Newbie Poster
Vonzarovitzch
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.