Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
| Search | Today's Posts | Mark Forums Read
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 25th, 2004, 10:53 AM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default writing to a database

i have a database called customers. i want to create a form which passes the data into the customer database.
i think below is the correct code for sending the data. but where do i place this code on my form.
thanks in advance

<?php

/* Connecting, selecting database */
$link = mysql_connect("localhost", "233560", "233560")
   or die("Could not connect : " . mysql_error());
mysql_select_db("db_233560") or die("Could not select database");

// Input info to table
 $query = "INSERT INTO customers VALUES('" . $pagefrom . "','" . $first_name . "','" . $last_name . "','" . $delivery_address . "','" . $billing_address . "','" . $purchase_quantity . "','" . $comments . "')";

print $query; //Copy and execute the query in MYSQL db, that resulted
              //in the above print and see if that inserts data
              //successfully.


//Close db
 mysql_close($link);
?>

 
Old March 25th, 2004, 11:10 AM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

not to worry, solved it





Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing to Database Scripts82 ASP.NET 1.0 and 1.1 Professional 8 September 15th, 2006 07:47 AM
Trouble writing database MDrumm Classic ASP Databases 5 August 4th, 2005 03:27 PM
Writing to Database - Please Help Dwizz VB.NET 2002/2003 Basics 12 May 11th, 2005 08:37 AM
Writing data to database cdenequolo Classic ASP Databases 2 August 17th, 2004 08:00 PM
Writing to an external database scottiegirl MySQL 4 March 2nd, 2004 04:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.