Re: Adding a new entry using PHP
| From: | Catalin Trifu | Date: | Thu, 08 Apr 2004 09:46:09 +0000 |
| Subject: | Re: Adding a new entry using PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182805@lists.php.net to get a copy of this message | ||
Hi,
Check http://php.weblogs.com/adodb
Catalin
P.S.
Welcome to PHP :)
"Alistair Hayward" <alistair@co-sys.co.nz> wrote in message
news:20040408002418.25032.qmail@pb1.pair.com...
> Hi,
>
> I am an ASP user, now learning PHP.
>
> When adding a record in ASP, I do this:
>
> Recordset.AddNew
> Field1 = whatever
> RecordSet.Update
>
> How is this done in PHP?
>
> I have built a recordset using a query, and have all the information
> needed to go into the different fields, but how do I 'Edit' or 'AddNew'
> and 'Update'?
> This is what I have:
>
> <?php
>
> unset($price);
> $price = $_GET['Price'];
>
> unset($id);
> $id = $_GET['id'];
>
> unset($partnumber);
> $partnumber = $_GET['PartNumber'];
>
> unset($disc);
> $disc = $_GET['Disc'];
>
> $link = mysql_connect('localhost', 'root', 'password');
> if (!$link) {
> echo "Couldn't make a connection!";
> exit;
> }
> $db = mysql_select_db("order", $link);
> if (!$db) {
> echo "Couldn't select database!";
> exit;
> }
> $sql= "SELECT * FROM tborder WHERE sid='session.sessionid'";
> $result = mysql_query($sql);
>
> $total_records = mysql_num_rows($result);
>
>
> ?>