Welcome! Log In Create A New Profile

Advanced

PHP 13: Manipulate a MySQL Database

Posted by mm77509382 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar PHP 13: Manipulate a MySQL Database
February 25, 2012 10:18PM
Completed.

For some reason I had to change my password to 'root' and server from '127.0.0.1' to 'localhost' for it to work (using MAMP).

Any insight into why I had to change '127.0.0.1' to 'localhost' would be appreciated.
I was getting the following error:
Lost connection to MySQL server at 'reading initial communication packet'
Thanks
Re: PHP 13: Manipulate a MySQL Database
February 26, 2012 11:43PM
Hi, I found the same thing using Wamp. You must use localhost for your server not 127.0.0.1 smiling smiley I am also not sure why it does not work with the IP address but after looking online I found this:

It is key point to set C:/Windows/System32/drivers/etc/[host file]
as said: uncomment line
#127.0.0.1 localhost
(remove sharp sign).

Not sure if it will work for everyone. But I think using localhost is fine. It works the same.
Re: PHP 13: Manipulate a MySQL Database
March 02, 2012 03:57PM
I think it the same, it just that it easier to remember words than numbers.
Re: PHP 13: Manipulate a MySQL Database
March 02, 2012 10:33PM
I have completed this section.
Re: PHP 13: Manipulate a MySQL Database
March 03, 2012 12:06PM
owned this section
Re: PHP 13: Manipulate a MySQL Database
March 09, 2012 01:03PM
I have a bit of a problem, I've been struggling the last two days with this.
I'm at the section of MagicQuotes on how to secure your form fields to protect your mySQL databases.

Thing it I can test and play around with it as I don't know where to place the "membertest" databases. If I put it exactly where they say it doesn't pick up the databases.
I can't find my created addressbook database in the easyphp/data/mysql folder either, and it's supposed to be there.

Where can I find my addressbook database? Any ideas, because if I can find that...then I'll know where to put the membertest databases.
avatar
Mac
Re: PHP 13: Manipulate a MySQL Database
March 09, 2012 02:49PM
Where did you install XAMPP (or EasyPHP)?
Re: PHP 13: Manipulate a MySQL Database
March 09, 2012 03:15PM
mac Wrote:
-------------------------------------------------------
> Where did you install XAMPP (or EasyPHP)?

I installed it to:
C:\Program Files (x86)\EasyPHP-5.3.3
avatar Re: PHP 13: Manipulate a MySQL Database
March 09, 2012 04:44PM
place it in here C:\Program Files (x86)\EasyPHP-5.3.9\mysql\data am sure you using Windows 7 like I do.smile
Re: PHP 13: Manipulate a MySQL Database
March 10, 2012 02:41PM
Mine is like this [C:\Program Files\xampp\mysql\data] and everything seems to be in good condition.
Re: PHP 13: Manipulate a MySQL Database
March 10, 2012 02:43PM
I've completed this section
Re: PHP 13: Manipulate a MySQL Database
March 11, 2012 03:50PM
Guyz syntax errors solutions can be found on a website called www.w3schools.com
Re: PHP 13: Manipulate a MySQL Database
March 11, 2012 09:09PM
I finished this section. Spent some extra time on it because I found it a bit more difficult to wrap my head around than other chapters. The textbook explained it more clearly than the tuts, and also shows how to make a database with php which was pretty cool.
Re: PHP 13: Manipulate a MySQL Database
March 12, 2012 08:33AM
77553055 Wrote:
-------------------------------------------------------
> place it in here C:\Program Files
> (x86)\EasyPHP-5.3.9\mysql\data am sure you using
> Windows 7 like I do.smile

YAY! Found it!

For some strange reason my databases are being saved in my old XAMPP folder...
is there anyway I can fix this so that it EASYPHP saves my databases in my easyphp folder?
avatar Re: PHP 13: Manipulate a MySQL Database
March 12, 2012 10:29AM
Copy the folders of the data yu have created in data storage folder in xampp and place it into this directory, i guess it should work. Try to unistall xampp, because we were informed not to install both...
Re: PHP 13: Manipulate a MySQL Database
March 12, 2012 10:50AM
77553055 Wrote:
-------------------------------------------------------
> Copy the folders of the data yu have created in
> data storage folder in xampp and place it into
> this directory, i guess it should work. Try to
> unistall xampp, because we were informed not to
> install both...


no it doesn't work!
I have uninstalled XAMPP, but it doesn't get rid of the mysql folder...and when I try to manually delete it, it says I can't because there are files in use.
Will try restarting my pc and then delete.
Re: PHP 13: Manipulate a MySQL Database
March 12, 2012 01:25PM
the section is so interesting,im using local host instait of 127.0.0.1 and it working ohk
Re: PHP 13: Manipulate a MySQL Database
March 16, 2012 01:50PM
Is there a difference when connecting to a database between:

Language: PHP
mysql_select_db($database);
and
Language: PHP
mysql_select_db($database, $db_handle);

In the tutorial it says that the file handle returns a value from $mysql_connect, and then it can be used to refer to a database, but how is it different than the first on? Any advice on best practices would be appreciated.
avatar
Mac
Re: PHP 13: Manipulate a MySQL Database
March 16, 2012 02:18PM
When you need to connect to different db's in one script, then the latter. Each person has their own preferences, and there are milliseconds differences, so it will depend on the complexity of your script. For me, I connect once (therefore not needing the handle) so it is less typing. But then I am inherently lazy smiling smiley
Re: PHP 13: Manipulate a MySQL Database
March 19, 2012 01:43PM
Completed this section.
Re: PHP 13: Manipulate a MySQL Database
March 19, 2012 05:52PM
Finished section 13.
Re: PHP 13: Manipulate a MySQL Database
March 23, 2012 04:14PM
I have completed this section.
Re: PHP 13: Manipulate a MySQL Database
March 23, 2012 04:27PM
Re: PHP 13: Manipulate a MySQL Database
March 23, 2012 04:43PM
Here is a short write up on how PHP 5.4.0 has removed magic quotes.....Removal of magic quotes
Re: PHP 13: Manipulate a MySQL Database
April 02, 2012 08:16PM
This was interesting,now i have a clue about databases
Re: PHP 13: Manipulate a MySQL Database
April 24, 2012 10:14PM
Done
Sorry, you do not have permission to post/reply in this forum.