Current Events
So, Onion.
Zero (6)Board List | Topic List | Post New Message | FAQ | TOS | Log Out | Online: 4
From: Magician Type 0 Posted: 3/5/2004 6:48:50 PM | Options | #001
6: New User How exactly dynamic is your source?

If I wanted to run it with, let's say - MS SQL - would it work?
From: Onion Posted: 3/5/2004 6:55:01 PM | Options | #002
30: Administrator Well considering that I'm using mysql and all the PHP mysql functions start with "mysql_", they wouldn't.
From: Magician Type 0 Posted: 3/5/2004 6:58:03 PM | Options | #003
6: New User Then make it so it does.

Make functions like:


Those are all you should really need.

You can make it work with I think up to five databases this way (fbsql, msql, mssql, mysql, sybase).

Basically, the functions would do this:

($_DB variables are declared in the config file)

function sql_query($sql)
global $_DB;
if($_DB['type'] == 'fbsql')
return fbsql_query($sql);
if($_DB['type'] == 'msql')
return msql_query($sql);
if($_DB['type'] == 'mssql')
return mssql_query($sql);
if($_DB['type'] == 'mysql')
return mysql_query($sql);
if($_DB['type'] == 'sybase')
return sybase_query($sql);
From: Magician Type 0 Posted: 3/5/2004 6:58:13 PM | Options | #004
6: New User Ugh. It killed my tabs. Oh well.
From: Magician Type 0 Posted: 3/5/2004 6:58:47 PM | Options | #005
6: New User The only thing is... You're going to have to replace "mysql" with "sql" everywhere in your source...
From: Onion Posted: 3/5/2004 7:03:09 PM | Options | #006
30: Administrator Wow, you must be stupid or something.

Only I will be using this source and I will only use it with a MySQL db. No one is getting this source (except Ant and uG who have the original version of it) so there's no point to porting it to any other platform.

ps: your function is embarassing.
From: Magician Type 0 Posted: 3/5/2004 7:04:26 PM | Options | #007
6: New User Why, because the tabs were murdered?

I told you it killed the tabs.

And why aren't you going to release it? Never?
From: Onion Posted: 3/5/2004 7:09:28 PM | Options | #008
30: Administrator No, because it could be made much easier. Like this:
function sql_thinger ( $query ) { global $dbtype; switch($dbtype) { case 'mysql': $thing = 'mysql_query'; break; case 'mssql': $thing = 'mssql_query'; break; . . . } return (eval ($thing.'('.$query.');'));}
Or something.

And I'm not releasing it because losers like you will take the source, modify it just barely, and call it your own. Whores.
From: Onion Posted: 3/5/2004 7:10:44 PM | Options | #009
30: Administrator ~_~
From: Magician Type 0 Posted: 3/5/2004 7:19:15 PM | Options | x | #010
6: New User /* This message was deleted by its poster */
From: Magician Type 0 Posted: 3/5/2004 7:19:38 PM | Options | #011
6: New User I'm writing my own source now.

And also...

Switches never work with strings in other languages (Java). So I really don't want to get into bad habits in using them like that in PHP.
From: Game555 Posted: 3/5/2004 7:24:31 PM | Options | #012
6: New User Onion will give me the source <_<
From: Onion Posted: 3/5/2004 7:26:44 PM | Options | #013
30: Administrator Well if you aren't retarded, it shouldn't be hard to discern between Java and PHP when writing scripts in either language.
From: Magician Type 0 Posted: 3/5/2004 7:30:23 PM | Options | #014
6: New User Look...

PHP came after Java. PHP is a web-scripting language based off of Java and C++.

PHP allows laziness with that switch.

I'm not forming bad habits over something like that.
From: Onion Posted: 3/5/2004 7:34:36 PM | Options | #015
30: Administrator It's not a bad habit, it's part of the language construct.

Maybe if you actually read the PHP manual you wouldn't be talking out of your ass half as often.
From: Magician Type 0 Posted: 3/5/2004 7:36:58 PM | Options | #016
6: New User ...You're a fucking idiot.

Switches are only meant to be used on integer datatypes and character datatypes.

Because of PHP's stupid lack of declaration and initialization of variables, we get this lazy bullshit coding.

That's the reason why that stupid SQL-inject bug exists in some versions of MA.

It's because there's no fucking datatypes.

So stop saying that I'm talking out of my ass when the only fucking language you know is PHP.
From: Junk Posted: 3/5/2004 7:37:59 PM | Options | #017
5: Provisional I've read through the PHP manual way too many times. ._.

Being bored is bad for me.
From: Onion Posted: 3/5/2004 7:39:01 PM | Options | #018
30: Administrator I'm the idiot? You're acting like you invented computer programming.
From: Deus Ex Raijin Posted: 3/5/2004 7:40:00 PM | Options | #019
6: New User Hey, mt0, can you say "fuck" again for me? It makes me horny.
From: Magician Type 0 Posted: 3/5/2004 7:44:50 PM | Options | #020
6: New User No I'm not.

You're the one who's making yourself look like an idiot by saying that the PHP switch using strings isn't lazy programming.
From: Deus Ex Raijin Posted: 3/5/2004 7:47:58 PM | Options | #021
6: New User
From: Deus Ex Raijin Posted: 3/5/2004 7:49:57 PM | Options | #022
6: New User Mt0, is that your spouse?