The Geek Forum

  • May 09, 2024, 03:41:14 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Due to the prolific nature of these forums, poster aggression is advised.

*

Recent Forum Posts

Shout Box

Members
Stats
  • Total Posts: 129619
  • Total Topics: 7184
  • Online Today: 140
  • Online Ever: 1013
  • (January 12, 2023, 01:18:11 AM)

Author Topic: SQL  (Read 2518 times)

HeavyJay

  • Hacker
  • ****
  • Coolio Points: +72/-1
  • Offline Offline
  • Posts: 1500
  • Gorn Tamer
    • View Profile
SQL
« on: January 02, 2003, 04:01:16 AM »

Ok, I read a good deal about the basics of SQL for data entry/sorting/aggregate function, but it didn't mention a damned thing about what extention to give anything, where to upload it, how to access it, etc.

Little help?   :oops:
Logged
"Don't just eat that hamburger, eat the HELL out of it!" -- JR "Bob" Dobbs

hob goblin

  • Professional Blogger
  • ***
  • Coolio Points: +2/-2
  • Offline Offline
  • Posts: 651
    • View Profile
    • http://www.ice-on-fire.net
SQL
« Reply #1 on: January 02, 2003, 04:04:27 PM »

SQL isn't a language like that, it's used in other languages to help communicate with databases (MySQL, Postgre, Oracle, Access)

it is used in another language, like PHP or ASP.

here is an example PHP (.php) script:

Code: [Select]

<?

mysql_connect("localhost", "username", "password");
mysql_select_db("database");

$query = mysql_query("INSERT INTO table (column1, column2) values ('row1a', 'row1b')");

$query2 = mysql_query("SELECT * FROM table WHERE column1 = 'row1a'");

$data = mysql_fetch_assoc($query2);

echo $data['column1']; // prints 'row1a'
echo $data['column2']; // prints 'row1b'

?>


[edit]

Sometimes, large series of queries, such as backups, are stored in files and then loaded to execute, their extension doesn't really matter as it is just a text file, but they are usually either named *.sql.  phpMyAdmin supports running queries from files.
Logged

Anonymous

  • Guest
SQL
« Reply #2 on: January 03, 2003, 07:42:37 AM »

Embeding SQL statements in VB or other applications is really a sloppy way of doing things. What you really want to do is build stored procedures and then have your programs run them. It's will improve response time as well.

Are you running the actually SQL server or MSDE?
Logged

hob goblin

  • Professional Blogger
  • ***
  • Coolio Points: +2/-2
  • Offline Offline
  • Posts: 651
    • View Profile
    • http://www.ice-on-fire.net
SQL
« Reply #3 on: January 03, 2003, 01:38:32 PM »

Quote from: TheJudge
Embeding SQL statements in VB or other applications is really a sloppy way of doing things. What you really want to do is build stored procedures and then have your programs run them. It's will improve response time as well.

Are you running the actually SQL server or MSDE?


I doubt he's making VB applications or anything of that sort because he was talking about uploading and accessing, so it would make me think hes talking about ASP, PHP, or Perl.  And if he's talking about those, he's either talking about MySQL, or Access, or some variant.
Logged

HeavyJay

  • Hacker
  • ****
  • Coolio Points: +72/-1
  • Offline Offline
  • Posts: 1500
  • Gorn Tamer
    • View Profile
SQL
« Reply #4 on: January 03, 2003, 11:01:58 PM »

I'm working with PHP and and I'm talking about MySQL.  Unfortunately, I've no clue how to run the latter  :oops:
Logged
"Don't just eat that hamburger, eat the HELL out of it!" -- JR "Bob" Dobbs

hob goblin

  • Professional Blogger
  • ***
  • Coolio Points: +2/-2
  • Offline Offline
  • Posts: 651
    • View Profile
    • http://www.ice-on-fire.net
SQL
« Reply #5 on: January 04, 2003, 12:19:45 AM »

Talk to your host about it.
Logged

drDigital

  • Annoying Newbie
  • *
  • Coolio Points: +0/-0
  • Offline Offline
  • Posts: 44
    • View Profile
SQL
« Reply #6 on: January 07, 2003, 10:28:59 PM »

Yes, PHP IS GOOD TO INTERFACE WITH MySQL.

Try www.mysql.com and d/l it if you run a host on your machine or www.freesql.org if your web host doesn't support MySQL (i have no experience with freesql.org, but it looks neat).

If you need more help, holler  :wink:
Logged
[ drDigital ]
[ dr_digital@hotmail.com ]