Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases 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 April 11th, 2005, 03:04 PM
Registered User
 
Join Date: Apr 2005
Location: miami, fl, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default It wont Connect toMySQLChapter 3,Page 95-98,

It wont connect to MySQL Server 4.1 from PHp runnunig the code below. This is the very 1st time i try to build a DataBase at all.
Can not get it to work. ""HELP PLEASE"!!
"I have been stock for days now." FROM A BEGINER (alevele@hotmai.com)
MYSQL SERVER 4.1

ERROR output Mesage ON BROWSER:

---Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Program Files\Apache Group\Apache2\Test\createmovie.php on line 8
Hey check yourn connection.---

CODE:
<body>

<?php
-LINE 8- $connect = mysql_connect("localhost", "root", "MYPASSWORD") or die ("Hey check yourn connection.");

//Create a Data base
mysql_create_db("wiley")
or die(mysql_error());

// verify the current DB is the activeone
mysql_select_db ("wiley");

//Create "movie" table
$movie = "CREATE TEBLE movie (
    movie_id int(11) NOT NULL auto_increment,
    movie_name varchar(255) NOT NULL,
    movie_type tinyint(2) NOT NULL default 0,
    movie_year int(4) NOT NULL default 0,
    movie_leadactor int(11) NOT NULL default 0,
    movie_director int(11) NOT NULL default 0,
    PRIMARY KEY (movie_id),
    KEY movie_type (movie_type,movie_year)
    ) TYPE=MyISAM AUTO_INCREMENT=4 ";

    $results = mysql_query($movie)
    or die (mysql_error());

//Create "movietype" table
$movietype = "CREATE TABLE movietype (
    movietype_id int(11) NOT NULL auto_increment,
    movietype_label varchar(100) NOT NULL,
    PRIMARY KEY (people_id)
    )TYPE=MyISAM AUTO_INCREMENT=9";

$results = mysql_query($movietype)
or die(mysql_error());

// Create "people" Table
$people = "CREATE TABLE people (
    people_id int(11) NOT NULL auto_increment,
    people_fullname varchar(255) NOT NULL,
    people_isactor tinyint(1) NOT NULL default 0,
    people_isdirector tinyint(1) NOT NULL default 0,
    PRIMARY KEY (people_id)
) TYPE=MyISAM AUTO_INCREMENT=7";
$results = mysql_query($people)
    or die(mysql_error());

echo "Movie Database sucesfully created! ";
?>

</body>
</html>
Reply With Quote
  #2 (permalink)  
Old April 13th, 2005, 10:10 AM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need to add the following to your my.ini file
(Mine is placed after the Server section under [mysqld])

old-passwords

After adding it, restart mysql and/or your system

Quote:
quote:Originally posted by Alej
 It wont connect to MySQL Server 4.1 from PHp runnunig the code below. This is the very 1st time i try to build a DataBase at all.
Can not get it to work. ""HELP PLEASE"!!
"I have been stock for days now." FROM A BEGINER (alevele@hotmai.com)
MYSQL SERVER 4.1

ERROR output Mesage ON BROWSER:

---Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Program Files\Apache Group\Apache2\Test\createmovie.php on line 8
Hey check yourn connection.---

CODE:
<body>

<?php
-LINE 8- $connect = mysql_connect("localhost", "root", "MYPASSWORD") or die ("Hey check yourn connection.");

//Create a Data base
mysql_create_db("wiley")
or die(mysql_error());

// verify the current DB is the activeone
mysql_select_db ("wiley");

//Create "movie" table
$movie = "CREATE TEBLE movie (
    movie_id int(11) NOT NULL auto_increment,
    movie_name varchar(255) NOT NULL,
    movie_type tinyint(2) NOT NULL default 0,
    movie_year int(4) NOT NULL default 0,
    movie_leadactor int(11) NOT NULL default 0,
    movie_director int(11) NOT NULL default 0,
    PRIMARY KEY (movie_id),
    KEY movie_type (movie_type,movie_year)
    ) TYPE=MyISAM AUTO_INCREMENT=4 ";

    $results = mysql_query($movie)
    or die (mysql_error());

//Create "movietype" table
$movietype = "CREATE TABLE movietype (
    movietype_id int(11) NOT NULL auto_increment,
    movietype_label varchar(100) NOT NULL,
    PRIMARY KEY (people_id)
    )TYPE=MyISAM AUTO_INCREMENT=9";

$results = mysql_query($movietype)
or die(mysql_error());

// Create "people" Table
$people = "CREATE TABLE people (
    people_id int(11) NOT NULL auto_increment,
    people_fullname varchar(255) NOT NULL,
    people_isactor tinyint(1) NOT NULL default 0,
    people_isdirector tinyint(1) NOT NULL default 0,
    PRIMARY KEY (people_id)
) TYPE=MyISAM AUTO_INCREMENT=7";
$results = mysql_query($people)
    or die(mysql_error());

echo "Movie Database sucesfully created! ";
?>

</body>
</html>
Reply With Quote
  #3 (permalink)  
Old April 16th, 2005, 03:21 PM
Registered User
 
Join Date: Apr 2005
Location: miami, fl, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I did set up my password by using :
"set password for root@loacalhost=password('your_password');
log out "\q", and then log back with:
mysql -u root -p,
prompts for password! 'yourpassword'
and then I get the wellcome monitor screen.
then I make sure I place the same password in my PHP script, at hte
mysql_connect () function.
and I now get : Can't create database 'wiley'. Database exists.
My hole next week will be dvoted to this message NOW..


Quote:
quote:Originally posted by vaderj
 You need to add the following to your my.ini file
(Mine is placed after the Server section under [mysqld])

old-passwords

After adding it, restart mysql and/or your system

Quote:
quote:Originally posted by Alej
 It wont connect to MySQL Server 4.1 from PHp runnunig the code below. This is the very 1st time i try to build a DataBase at all.
Can not get it to work. ""HELP PLEASE"!!
"I have been stock for days now." FROM A BEGINER (alevele@hotmai.com)
MYSQL SERVER 4.1

ERROR output Mesage ON BROWSER:

---Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Program Files\Apache Group\Apache2\Test\createmovie.php on line 8
Hey check yourn connection.---

CODE:
<body>

<?php
-LINE 8- $connect = mysql_connect("localhost", "root", "MYPASSWORD") or die ("Hey check yourn connection.");

//Create a Data base
mysql_create_db("wiley")
or die(mysql_error());

// verify the current DB is the activeone
mysql_select_db ("wiley");

//Create "movie" table
$movie = "CREATE TEBLE movie (
    movie_id int(11) NOT NULL auto_increment,
    movie_name varchar(255) NOT NULL,
    movie_type tinyint(2) NOT NULL default 0,
    movie_year int(4) NOT NULL default 0,
    movie_leadactor int(11) NOT NULL default 0,
    movie_director int(11) NOT NULL default 0,
    PRIMARY KEY (movie_id),
    KEY movie_type (movie_type,movie_year)
    ) TYPE=MyISAM AUTO_INCREMENT=4 ";

    $results = mysql_query($movie)
    or die (mysql_error());

//Create "movietype" table
$movietype = "CREATE TABLE movietype (
    movietype_id int(11) NOT NULL auto_increment,
    movietype_label varchar(100) NOT NULL,
    PRIMARY KEY (people_id)
    )TYPE=MyISAM AUTO_INCREMENT=9";

$results = mysql_query($movietype)
or die(mysql_error());

// Create "people" Table
$people = "CREATE TABLE people (
    people_id int(11) NOT NULL auto_increment,
    people_fullname varchar(255) NOT NULL,
    people_isactor tinyint(1) NOT NULL default 0,
    people_isdirector tinyint(1) NOT NULL default 0,
    PRIMARY KEY (people_id)
) TYPE=MyISAM AUTO_INCREMENT=7";
$results = mysql_query($people)
    or die(mysql_error());

echo "Movie Database sucesfully created! ";
?>

</body>
</html>
Reply With Quote
  #4 (permalink)  
Old August 29th, 2006, 11:37 PM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have been working on the same file. Did you ever get yours to work? I received the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'people_isactor tinyint(1) NOT NULL default 0, PRIMARY KEY (people_id) )' at line 4

Here is the code:

$people = "CREATE TABLE people (
     people_id int(11) NOT NULL auto_increment,
    people_fullname varchar(255) NOT NULL
    people_isactor tinyint(1) NOT NULL default 0,
    people_isdirector tinyint(1) NOT NULL default 0,
    PRIMARY KEY (people_id)



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
Chapter 3 Page 95 jumpot89 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 6 April 22nd, 2009 03:11 AM
Chapter 3 page 95 nead23 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 March 26th, 2009 09:28 AM
Chapter 3, page 95 Swerve1000 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 May 29th, 2007 04:45 PM
Getversion issue with Windows 95/98 ? maxpotters Beginning VB 6 2 August 4th, 2005 08:40 AM



All times are GMT -4. The time now is 03:09 PM.


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