Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
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 July 20th, 2006, 09:51 PM
Authorized User
 
Join Date: Jul 2006
Posts: 73
Thanks: 11
Thanked 1 Time in 1 Post
Default problem connect to MySql from script

Hello everyone, I ned help to connect from My Pc to MySql on Web by this code !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
  "http://www.w3.org/TR/html4/lose.dtd" >
<html>
<!-- Created on: 22.06.2006
-->
<head>
<title>Wines </title>
</head>
<body bgcolor="#F5F5F5">

<pre>
<?php

@ $db = mysql_pconnect("localhost","nbanene","kontakt");
if (!$db)
{
echo "Error: Could not connect to database.";
      exit;
}
mysql_select_db("winestore",$conection);
//
//
$query = "INSERT INTO customer VALUES(NULL,'Marzala','Dimitria','F','Mr','171 Tritshall Ccl','','St Albans','WA','7608','Ausrealia','(618)63576028','' ,'[email protected]','1969-11-08',35000)";
//
//
$result = mysql_query($query);
if (!$result)
 echo mysql_affected_rows().'region inserted into database';
  //
 echo"\n";
 }
 //
 msql_close($conection);
 ?>
</pre>
</body>
</html>
.
I don't know what i ned to specify in the code.

 
Old July 25th, 2006, 07:23 PM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First try to connect to your MySQL server with a command-line or graphical query client. For a graphical client, I prefer MySQL Query Browser (http://dev.mysql.com/downloads/query-browser/1.1.html). Once you've figured out how to connect to it manually, it should be pretty straight-forward to copy over the parameters you used into your PHP code.

Jon Emerson
http://www.jonemerson.net/





Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql connect problem protozoa JSP Basics 3 August 17th, 2004 12:21 AM
Best way to connect to mySQL netdaviso Java Databases 1 April 5th, 2004 06:37 AM





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