[PHP-DB] OBDC date problems

2001-04-11 Thread Walter Franssen


Hello, i have some problems with date's in a query like

SELECT * FROM news WHERE fdate = $date AND tdate = #date

Can someone help me



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] ALTER TABLE - code not working.

2001-03-29 Thread Walter Franssen


Is the SQL statment correct. Don't is must be

ALTER TABLE vips ADD COLUMN $NewCol VARCHAR(50) NULL";


-Original Message-
From: Jason Stechschulte [mailto:[EMAIL PROTECTED]]
Sent: donderdag 29 maart 2001 16:29
To: Martin E. Koss
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] ALTER TABLE - code not working.


On Thu, Mar 29, 2001 at 12:20:41PM +0100, Martin E. Koss wrote:
 I have been trying to get a new column added to a table (vips) via a PHP
 script, but having exhausted all the things I can find, I'm still
 struggling. I've referred t TFM for all those who just can't wait to tell
me
 to do so, and believe my SQL statement is correct:

 $NewCol = $Prod_Code;
 $defaultvalue = "0.00";
 // make usual connection
 $conID = mysql_pconnect ("localhost","admin","mek1233");
 mysql_select_db("FocusDynamics", $conID);
 // set the query
 $AddColQuery = "ALTER TABLE vips ADD COLUMN $NewCol";
 $result = mysql_query ($AddColQuery,$conID);
 // now set the default value for all rows in vips table
 $SetDefault = "UPDATE TABLE vips SET $NewCol=$defaultvalue";
 $result = mysql_query ($SetDefault,$conID);

 It is NOT adding the column, and obviously not setting the default.

If you haven't gotten a fix for this yet, then try adding:

echo "$AddColQuerybr\n".mysql_error($conID)."br\n";

after your mysql_query() call.  This allows you to see the exact sql you
are executing, and you will get to see the error mysql is returning.
This has helped me find something strange with what I was doing when I
could have sworn there was nothing wrong with my code.

--
Jason Stechschulte
[EMAIL PROTECTED]
--
As someone pointed out, you could have an attribute that says "optimize
the heck out of this routine", and your definition of heck would be a
parameter to the optimizer.
 -- Larry Wall in [EMAIL PROTECTED]

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]