Jump to content

Recommended Posts

Posted

First off, I am a MySql newbie and I just started teaching myself PHP.

 

I am trying to figure out how to query a MySql database and I have no idea how to structure it. I have read a few things online, but the sites I found still left me confused. Does anyone good resources (either online or book) on doing MySql? The more examples of queries the better.

Posted (edited)

php.net is where I learned to merge php and MySQL. but then if you're tying to learn MySQL, a good site would be W3 Schools. I used that page for a lot of web related stuff (CSS and stuff).

 

php.net -> more specific there is a good example and a list of all the php functions useful to use mysql.

Edited by bboyjay
Posted
php.net is where I learned to merge php and MySQL. but then if you're tying to learn MySQL, a good site would be W3 Schools. I used that page for a lot of web related stuff (CSS and stuff).

 

php.net -> more specific there is a good example and a list of all the php functions useful to use mysql.

Thanks for the help.

 

I don't have a problem with the PHP side, it is more the MySQL query structure I am confused with. PHP.net is a good source, if you know what you are looking for. Unfortunately, their examples of queries are limited and pretty basic.

 

As for W3 Schools, they don't have anything on MySQL queries that I could find. It is an excellent site, I have used it before to learn CSS and as a basic HTML resource.

Posted

I've used the tutorials at

 

Codewalkers -- ht*tp://codewalkers.com

and

PHP Builder -- ht*tp://phpbuilder.com

 

They're a little pick-and-mix as to what they actually have tutorials on, but the ones they do have I used quite a bit when I was learning.

Posted

I don't recall seeing it, but is there a "MySQL for Dummies" out there? I love their books! They explain things in simple, down-to-earth terms that are easy to comprehend and remember.

Posted

From the reviews I read online, the PHP/MySQL for Dummies book doesn't seem that good. I had one when I was learning Unix and wasn't to impressed. I learned more from the HP-UX reference manuals that came with the server then I did with the "Dummy" book.

 

Based on some of the reviews I read, I ordered a copy of "PHP and MySQL Web Development, Second Edition" by Luke Welling & Laura Thomson. I probably am still going to need something that strictly focuses on MySQL, but I am going to wait and see if I can figure it using the sites people have mentioned and the book I ordered.

 

Thanks for all the good suggestions! :P

Posted

Well, with the site that Don gave me, it got me going. The book I ordered was no help, only since I haven't received it yet. :)

 

Here is the query I needed (the names have been changed to protect the innocent).

 

>$sql = "SELECT s.table_row,
        COUNT(s2.shout_id) AS table_row_number
        FROM ".SQLTABLE." s, ".SQLTABLE." s2
        WHERE s2.table_row >= ".$somenumber."
        AND s.table_row = ".$somenumber."
        GROUP BY s.table_row
        ORDER BY s2.table_row DESC";

Thanks again for all the help. This was fun, I can't wait until I get the book I ordered and I can learn to unlock the potential for using PHP & MySQL.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...