![]() |
Query Help - Just a question about writing a query...
I'm praciticing some queries and I have a couple questions. First, let me explain my practice queries -
I figured I'd just write a bunch of "INSERT INTO"'s for different calendar events (general holiday stuff). [sql] INSERT INTO calendar_events (eventid, userid, event, eventdate, public, subject, allowsmilies) VALUES (4, 1, 'Thanksgiving - US.\r\n\r\n\r\n', '2003-11-27', 1, 'Thanksgiving', 1); [/sql] My question is this - Must I set the eventid, or is there a way to have it automatically set itself. Reason being - I have events already added to the calendar and I just wondered if I needed to consecutively add all the eventid's appropriately or if it could do it magically itself. |
look into the field properties, if the field has the autoincrement enabled you can just set NULL as id and it'll use the highest free id ;)
|
Quote:
I believe it has autoincrement enabled for the eventid. Yes. *test* Sweeet! Thanks, Xenon. It worked like a charm. [high]* Rose takes note in lil' fat cheatsheet book and chalks another learning point up [/high] *hehe* |
Ok just another question that would build on this one. When I wanted to query for that information to echo it out for whatever and I set up a query somewhat like this:
PHP Code:
Sorry for the all questions I'm just very interested. :) |
PHP Code:
|
All times are GMT. The time now is 06:26 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|