Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Announcing: sNooze-IC  (Read 11673 times)

Joost

  • Guest
Re: Announcing: sNooze-IC
« Reply #15 on: January 31, 2009, 03:13:55 AM »

The following is probably the simplest.

Change

Code: [Select]
$cat = (int)$_POST['cat'];
to

Code: [Select]
$cat = 0;
if(isset($_POST['cat'])) $cat = (int)$_POST['cat'];

I prefer serverside defaults
Logged

Joost

  • Guest
Re: Announcing: sNooze-IC
« Reply #16 on: February 16, 2009, 11:00:08 AM »

- I started using mysql instead of mysqli  for a practical reason. When I began the project, I didn't have the mysqli library installed correctly. Changing it is futile, so I postponed it.... and forgot about it.

I have performed some tests recently, using mysqli.

Code: (OOPS style) [Select]
<?php
$mysqli 
= new mysqli("localhost""my_user""my_password""world");

if (
mysqli_connect_errno()) {  exit('Connect failed'); }

$mysqli->query("SELECT * FROM articles");
?>



Code: (Procedural style) [Select]
<?php
$link 
mysqli_connect("localhost""my_user""my_password""world");

/* check connection */
if (mysqli_connect_errno()) {
    
printf("Connect failed: %s\n"mysqli_connect_error());
    exit(
'Connect failed');
}

mysqli_query("SELECT * FROM articles");
?>

When using OOP, a new object needs to be instantiated in each function, when using procedural style, the source identifier ($link) has to be carried from function to function, using globals.
As you might know, I am not against globals. But I am against to many globals.
The number can easily grow beyond control.

I didn't find any real benefit, using mysqli, or it must have been mysqli::multi_query, but there is only one place where it might be useful: Page reordering. This is an admin task, which isn't performed that often. :-\
Logged

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: Announcing: sNooze-IC
« Reply #17 on: February 16, 2009, 05:54:34 PM »

As you might know, I am not against globals. But I am against to many globals.
The number can easily grow beyond control.

I didn't find any real benefit, using mysqli, or it must have been mysqli::multi_query, but there is only one place where it might be useful: Page reordering. This is an admin task, which isn't performed that often. :-\

Hell my friend, yes I agree with you.

My expirence tells me the global is good option, if you have not too many globals.
About msqli, I cannot see any benefits too.

You did a terrific job here, congratulations.
Logged
Need a Job on Europe. Linkdin - Facebook / Group

centered

  • Guest
Re: Announcing: sNooze-IC
« Reply #18 on: February 16, 2009, 09:36:30 PM »

Re: MySQLi:  Well some outside of this application may think otherwise, but yes for sNews, there isn't a huge difference. 
Logged

jean01

  • Newbie
  • *
  • Karma: 0
  • Posts: 46
Re: Announcing: sNooze-IC
« Reply #19 on: March 07, 2009, 02:59:08 AM »

Just a comment about SQLite.
I used it on a client application a while back that was at a shared host.
Even though it comes bundled with php5 they didn't give a hoot if they supported it or not so the application would go down and stay down for days at a time. 
I finally converted it to mySQL.

The shared host that I am working with right now say that they will not support SQLite so folks can use it at their own risk.

I don't know why hosts don't like it.  Perhaps they just cannot get the staff to support yet another database system and they figure supporting mySQL is enough.

This is something to keep in mind, though.
Logged

centered

  • Guest
Re: Announcing: sNooze-IC
« Reply #20 on: March 07, 2009, 03:21:06 AM »

Quote
I don't know why hosts don't like it.  Perhaps they just cannot get the staff to support yet another database system and they figure supporting mySQL is enough.

I would assume it is a money issue....  mySQL would cost more.
Logged

Joost

  • Guest
Re: Announcing: sNooze-IC
« Reply #21 on: March 07, 2009, 04:17:28 AM »

Even though it comes bundled with php5 they didn't give a hoot if they supported it or not so the application would go down and stay down for days at a time. 
You mean they disabled it? Why would they?
Logged

centered

  • Guest
Re: Announcing: sNooze-IC
« Reply #22 on: March 07, 2009, 01:32:25 PM »

This is getting off topic - but you don't have to compile PHP5 with sqlite support.  If you are on a Debian Linux system, you can just install/uninstall php5-sqlite - end of story - no sqlite.

Either case, I would switch servers if that was the case of not supporting sqlite
Logged

jean01

  • Newbie
  • *
  • Karma: 0
  • Posts: 46
Re: Announcing: sNooze-IC
« Reply #23 on: March 13, 2009, 07:30:27 PM »

This is getting off topic - but you don't have to compile PHP5 with sqlite support.  If you are on a Debian Linux system, you can just install/uninstall php5-sqlite - end of story - no sqlite.

Either case, I would switch servers if that was the case of not supporting sqlite
Well I switched from the first one, that's for sure.
The second one I really like so I have avoided sqlite so far.  Too bad, it's such a neat, light, fast db system that I would think hosts would be happy to see it used as it would be easier on server resources.
Sorry for getting this off topic.
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Announcing: sNooze-IC
« Reply #24 on: January 20, 2010, 03:05:09 PM »

Hey Mr Bear...
where are you now with this promising script?
Pages: 1 [2]