Re: [PHP-DB] Re: Interbase INSERTION error?

2001-03-14 Thread Sean Finkel

Technically, he shouldn't have to list the fields he is inserting into if he
is inserting into the fields in order. Unless that's some funky Interbase
requirement.

A parse error is usually a PHP syntactical error. Can you post the whole of
line "35" so we can see? :)


----
---
Sean Finkel - [EMAIL PROTECTED]
|H|eretik - Pain in the ass for Clan |H|avoc -
http://www.webdrenalin.com/ubbcgi/
Webmaster - Rabid Wolf .:: Food For Your Brain ::. -
http://www.rabid-wolf.com
Lead Programmer - Data Admin and Data Lib - http://dadmin.sourceforge.net

---
- Original Message -
From: "Walter van der Velden" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 14, 2001 2:29 PM
Subject: [PHP-DB] Re: Interbase INSERTION error?


>>hey all..
>>
>>I really don't get why I am getting this error.. Can somebody help me
>>out? what does a parse error mean?
>>Error:
>>Parse error: parse error in /home/httpd/html/test/php-test/CVzenden.php
>>on line 35
>>
>>CVzenden.php:
>>
>>$conn=ibase_connect("localhost:/home/httpd/html/test/php-test/CV.gdb",
>>"SYSDBA", "masterkey");
>>
>>if (!$conn) {
>>  echo "Accesso Denied! $back";
>>  exit;
>>
>>  }
>>
>>$query="insert into PERSOON values
('0','$TITELVOOR','$ROEPNAAM','$VOORNAAM','$INITIALEN','$TUSSENVOEG','$ACHTE
RNAAM',
>>'$TITELACHTER','$GESLACHT','$BURGSTAAT','$GEBOORTEDATUM','$GEBOORTEPLAATS'
,'$NATIONALITEIT','$STRAAT','$HUISNR',
>>'$POSTCODE','$PLAATSNAAM','$PROVINCIE','$LAND','$TELPRIVE','$TELWERK','$MO
BIEL','$FAX','$BESCHIKBAAR','$EMAIL','NOW','NOW');";
>>$result=ibase_query($conn,$query);
>>  if (!$result) {
>> echo "Error. Can't insert the record with the query: $query!
>> $back";
>> exit;
>> }
>> echo "Record saved: $name $back";
>> ibase_close($conn); ?>

You forgot to tell Interbase into which fields te values should be inserted.
Example: $query="insert into PERSOON(roepnaam,achternaam)
values($ROEPNAAM,$ACHTERNAAM);



-- 
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] add a column to a table via PHP

2001-03-13 Thread Sean Finkel

Wouldn't you also need the datatype of the new column (ie. Varchar)? :-)


-
Sean Finkel - [EMAIL PROTECTED]
|H|eretik - Pain in the ass for Clan |H|avoc
http://www.webdrenalin.com/ubbcgi/
Webmaster - Rabid Wolf .:: Food For Your Brain ::.
http://www.rabid-wolf.com
Lead Programmer - Data Admin and Data Lib
http://dadmin.sourceforge.net

-
- Original Message -
From: "ME" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 13, 2001 7:36 PM
Subject: RE: [PHP-DB] add a column to a table via PHP


The following assumes you've already selected the database and that $column
contains the name of the new column and $defaultvalue is the value to be
set.

$query = "ALTER TABLE Prices ADD $column DEFAULT \"$defaultvalue\"";
mysql_query($query) or die("Can't add column to Prices");

$query = "UPDATE TABLE Prices SET $column=$defaultvalue";
mysql_query($query) or die("Can't update table Prices");

And, yes, you are a bit lazy...  This is in the manual.

-Original Message-
From: Martin E. Koss [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 12:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] add a column to a table via PHP


Hi,
I'm probably being a bit lazy asking what I should be able to figure out,
but here goes anyway:

What I want to do, in response to certain other actions having taken place,
is add a column to a mySQL database (FocusShop) table (Prices) and set the
default value of that column and update all existing rows in that table to
the same value for that new column.

Has anyone got the correct way to do this?

Thanks,
Martin.



--
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]