Please read the documentation on date functions. That looks like one of
your problems.
Secondly, your not using any '' to encase your strings.
----- Original Message -----
From: "Ben Ocean" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2001 11:12 AM
Subject: Why Doesn't This Work???
> Hi;
> I insert the following code in a file:
>
> >>>
> $count = sql_command("select count(id) from calendar");
> $count = $count[0] + 1;
> $mydate = $month.','.$day.','.$year;
> echo $mydate;
> echo "<br>";
> echo $time;
> echo "<br>";
> echo $name;
> echo "<br>";
>
> sql_query("insert into calendar (id, date, time, duration, name) values
> ($count, $mydate, $time, 'one hour', $name)");
> echo $mydate;
> echo "<br>";
> echo $time;
> echo "<br>";
> echo $name;
> echo "<br>";
> echo $mydate;
> echo "<br>";
> echo $time;
> echo "<br>";
> echo $name;
> echo "<br>";
> <<<
>
> and get the following result:
>
> >>>
> February,26,2001
> 11:30
> Ben_Ocean
> February,26,2001
> 11:30
> Ben_Ocean
> <<<
>
> So all the variables are passing. Yet the mysql table isn't updated.
> *However*, if I substitute this line for the above:
>
> >>>
> sql_query("insert into calendar (id, date, time, duration, name) values
> ($count, $count, $count, 'one hour', $count)");
> <<<
>
> it enters a new column in the table! Why?!
> TIA,
> BenO
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php