RE: [PHP-DB] possible Error in Querydefiniton
| From: | John W. Holmes | Date: | Sun, 06 Oct 2002 19:39:30 +0000 |
| Subject: | RE: [PHP-DB] possible Error in Querydefiniton | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-22236@lists.php.net to get a copy of this message | ||
You can find out why with mysql_error(), but it's probably because you
haven't selected a database with mysql_select_db().
---John Holmes...
> -----Original Message-----
> From: root@linux [mailto:root@linux] On Behalf Of Ruprecht Helms
> Sent: Sunday, October 06, 2002 3:25 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] possible Error in Querydefiniton
>
> Hi,
>
> I've some trouble with the following querydefinition
>
> <?
> mysql_connect("localhost","root");
> mysql_db_query("finace","INSERT INTO buchung (Bezeichnung) VALUES
> ('b')")
> or die ("Query ungültig");
> ?>
>
> and this is the tablestructur
>
>
+-------------+--------------+------+-----+---------+----------------+--
--
> ------
> | Field | Type | Null | Key | Default | Extra |
> Privileges |
>
+-------------+--------------+------+-----+---------+----------------+--
--
> -----
> | ID | int(11) | | PRI | | auto_increment
|...
> | Bezeichnung | varchar(30) | YES | | | |
> | Art | char(1) | YES | | | |
> | Brutto | char(1) | YES | | | |
> | Betrag | decimal(8,2) | YES | | | |
> | Steuer | int(11) | | | 0 | |
>
+-------------+--------------+------+-----+---------+----------------+--
--
> ------
>
> By execution the script says that the query die. I don't know why.
>
> ------------------------------------------------------------
> Ruprecht Helms IT-Service und Softwareentwicklung
>
> Tel/Fax: +49[0]7621 16 99 16
> email: info@rheyn.de
> Homepage: http://www.rheyn.de
>
> -------------------------------------------------------------
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php