Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,143,328 members, 7,780,843 topics. Date: Friday, 29 March 2024 at 12:05 AM

Discussion Thread For MYSQL 5.5/5.6 - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Discussion Thread For MYSQL 5.5/5.6 (711 Views)

Best Collation Type For Mysql Database(Gurus only!) / Please Help!!! Mysql 5.6 Not Running On My Pc. / I Need Some One To Give Me A Free Opencart 1.5.6 Online Shop Themes (2) (3) (4)

(1) (Reply) (Go Down)

Discussion Thread For MYSQL 5.5/5.6 by cbrass(m): 5:33pm On Jul 07, 2014
Hello coders, Oracle announced last year that it will stop support for MYSQL 5.1, so some of us here will like to know what and what to change in our scripts since some hosts are already upgrading to MYSQL 5.5 at least.

Let's get the ball rolling grin
Re: Discussion Thread For MYSQL 5.5/5.6 by realugee: 6:38pm On Jul 07, 2014
following...
Re: Discussion Thread For MYSQL 5.5/5.6 by IamGodzilla: 7:06pm On Jul 07, 2014
For a start...switch to 'MySQLi' mysql-improved"...
Re: Discussion Thread For MYSQL 5.5/5.6 by cbrass(m): 8:18pm On Jul 07, 2014
IamGodzilla: For a start...switch to 'MySQLi' mysql-improved"...

Mr brother that thing not so easy like that, I can't count the number of mysql have used on my site and others, and with the way it takes two parameters
Re: Discussion Thread For MYSQL 5.5/5.6 by dhtml(m): 8:18pm On Jul 07, 2014
Exactly, mysqli I was forced to upgrade earlier this year.
Easier for me because I normally work with custom database wrapper. I was so used to drupal 6 database wrapper that I built a custom wrapper to work like it.
I just had to upgrade my wrapper.
Re: Discussion Thread For MYSQL 5.5/5.6 by cbrass(m): 8:27pm On Jul 07, 2014
But am not used to using 2 parameters, I keep bumping into errors often
Re: Discussion Thread For MYSQL 5.5/5.6 by IamGodzilla: 8:28pm On Jul 07, 2014
cbrass:

Mr brother that thing not so easy like that, I can't count the number of mysql have used on my site and others, and with the way it takes two parameters

Well, for better security and to stay away from future mysql issues..you should try to do that.
Re: Discussion Thread For MYSQL 5.5/5.6 by cbrass(m): 8:40pm On Jul 07, 2014
IamGodzilla:

Well, for better security and to stay away from future mysql issues..you should try to do that.

Of course I will
Re: Discussion Thread For MYSQL 5.5/5.6 by cbrass(m): 8:41pm On Jul 07, 2014
IamGodzilla:

Well, for better security and to stay away from future mysql issues..you should try to do that.
Re: Discussion Thread For MYSQL 5.5/5.6 by cbrass(m): 11:40pm On Jul 07, 2014
Any new sql syntax and additional queries ?
Re: Discussion Thread For MYSQL 5.5/5.6 by dhtml(m): 3:30am On Jul 08, 2014
And please remove strict mode from your my.ini otherwise you will encounter one strange problem.
Lets say you created a table like this:

table users:
ID int
username varchar 50
firstname varchar 50
lastname varchar 50

and you do not add a default value to lastname and firstname, the moment you write a query like this:
Update `users` set `username`='mumu' where `ID`='1'; you will get an error telling you that no default value set for firstname.
Re: Discussion Thread For MYSQL 5.5/5.6 by WebRabbi: 6:03am On Jul 08, 2014
My personal advice to all web developers is to used PDO and not MySQLi because of tomorrow you may want to upgrade to another database. If you use PDO, you don't need to start re coding again which is SIMPLE and BEST.
Re: Discussion Thread For MYSQL 5.5/5.6 by dhtml(m): 6:12am On Jul 08, 2014
^^^That is a good advice, however, i shall extend that advice to learn how to use both MySQLi and PDO, i can use both, but for personal reasons, i use msqli.
PDO and MySQLi are wrappers, i work with wrappers from time. So my db_query function which i have been using since the time of mysql, my pagination scripts and all that are what i still use now, only that i changed the internal codings to mysqli.
That way, my former applications that i did with mysql can be easily upgraded to mysqli, this is simple because mysql can be converted to mysqli almost on a line-by-line translation.
Re: Discussion Thread For MYSQL 5.5/5.6 by cbrass(m): 9:09am On Jul 08, 2014
dhtml: And please remove strict mode from your my.ini otherwise you will encounter one strange problem.
Lets say you created a table like this:

table users:
ID int
username varchar 50
firstname varchar 50
lastname varchar 50

and you do not add a default value to lastname and firstname, the moment you write a query like this:
Update `users` set `username`='mumu' where `ID`='1'; you will get an error telling you that no default value set for firstname.

But why nw
Re: Discussion Thread For MYSQL 5.5/5.6 by cbrass(m): 9:11am On Jul 08, 2014
WebRabbi: My personal advice to all web developers is to used PDO and not MySQLi because of tomorrow you may want to upgrade to another database. If you use PDO, you don't need to start re coding again which is SIMPLE and BEST.

Is PDO supported by all host

Think I have to brush my self on that since have had enough of mysql
Re: Discussion Thread For MYSQL 5.5/5.6 by dhtml(m): 9:34am On Jul 08, 2014
cbrass:

Is PDO supported by all host

Think I have to brush my self on that since have had enough of mysql
The answer is NO. It is supported, but not all webhosts enable it - reasons unknown to me. The first site i did exclusively with PDO failed because the server did not support it.
The latest drupal 7 installation comes with MySQLi, so if the drupal community decides to use MySQLi, i dont have a problem with it.

1 Like

Re: Discussion Thread For MYSQL 5.5/5.6 by WebRabbi: 10:09am On Jul 08, 2014
@ cbrass, from my personal experience most web host do support PDO and if the don't tell you webhost you need it. When I wanted to upgrade my old MySQL code, I really suffered a lot and I have to do thorough research before upgrading to final upgrade.

To me mysqli is good but PDO is best because tomorrow now you may not like MySQL again and needs to upgrade to another database. Hmmm, then is when you see big wahala again.

Recently, I have a web application I was developing for a company, I was coding with MySQL Database and suddenly my client request that I changed to another database because they have custom desktop program that will share the same database with the web application. Luck on my side I was using PDO and guess what I only have changed my connection string parameter because my MySQL tables and fields are the same with the new database. Of course, I charge him for the new development.

More so, to compare between both check
http://code.tutsplus.com/tutorials/pdo-vs-mysqli-which-should-you-use--net-24059
http://www.php.net/manual/en/mysqli.overview.php

1 Like

Re: Discussion Thread For MYSQL 5.5/5.6 by dhtml(m): 10:21am On Jul 08, 2014
This is not really an argument about who wins - whether pdo or mysqli. If you read my posts clearly, you will see that i did not recommend anyone in particular, except to condemn using mysql directly.
PDO - supports a lot of databases
MySQLi - supports only mysql
So it is safer to use PDO. However, if you are like me that you have an extensive library of codes using mysql and especially if you make use of wrapper functions, it is easier for you to upgrade your wrapper from mysql to mysqli. However, PDO will be better - if you can afford the time, it is definitely worth it.
Re: Discussion Thread For MYSQL 5.5/5.6 by WebRabbi: 12:02pm On Jul 08, 2014
@ dhtml. we are not arguing about anything here. However, we all giving advice to cbrass to enable him make his choices.
Re: Discussion Thread For MYSQL 5.5/5.6 by dhtml(m): 3:06pm On Jul 08, 2014
Is alright, just wanted to clarify things.
Re: Discussion Thread For MYSQL 5.5/5.6 by cbrass(m): 8:52pm On Jul 08, 2014
You know, I just like to learn things and use what is most relevant to my needs and that will not take too much of my time learning. I sincerely appreciate all responses and I know many people will learn one or two things from these

(1) (Reply)

I Really Need Webdesign Jobs! And I Am Good! / User Testing Required For This AUTOMATED MARKETING WEBSITE / Own Your Own Online Store Within Days!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 25
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.