Monday 15 September 2014

php - Get one "cell" from a mysql database -


I have a site that stores the settings in a mysql database table. To get a setting, I use something like this:

  $ q = mysql_query ("Select settings from where id = 1"); $ A = mysql_fetch_array ($ q); $ Setting = $ a ['setting'];   

But is there not a faster / better way to dump just one "cell" of a mysql table in a variable?

No, it is too much Some DB libraries have a - & gt; GetOne () provide a method of type, but internally they do nothing compared to you. Of course, you should stop using mysql _ * () functions. They are excluded / obsolete MySqli or PDO consider switching to

No comments:

Post a Comment