Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 20th, 2006, 09:51 PM
Authorized User
Points: 359, Level: 6
Points: 359, Level: 6 Points: 359, Level: 6 Points: 359, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: Belgrade, Serbia, Yugoslavia.
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','' ,'dimitria@lucaston.com','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.

Reply With Quote
  #2 (permalink)  
Old July 25th, 2006, 07:23 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
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/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:46 PM.


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