GetDotted Domains

Viewing Thread:
"PHP / mySQL - Help a beginner?"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Thu 04/11/04 at 19:04
Regular
"Picking a winner!"
Posts: 8,502
OK, as part of my final year at uni I have to do an individual project, a rather large one and to start of I need to create a webpage using php and mysql. Won't go into details of what the site has to do as thats not too important right now.
First off the basics.

I've looked at PHP once or twice before, so hopefully that wont be to bad.
Did a bit on SQL ages ago as well as some database work but I'm not sure whats different between SQL and mySQL.

Have downloaded all the stuff for apache, php and mySQL from [URL]http://www.aesthetic-theory.com/learn.php?server2[/URL] and installed before but something went wrong so I'm in the process of installing again just to make sure its all working properly.

Just not sure where to start.
Have a few ebooks to try make things easier but a few things that don't seem to clear....

mySQL files, someone give me an example of one and what the file type they are?

No doubt a few more things will crop up so I'll post them here too :0)

Thanks
Mon 08/11/04 at 22:31
Regular
"It goes so quickly"
Posts: 4,083
Garin wrote:
> MySQL supports a type/version of SQL, not the SQL standard.


Really? I was under the impression MySQL supported SQL completely, with a few additional MySQL custom SQL'd extras.

I used PHP in 24 hours from SAMS publishing to get me started, as well as online examples, and SQL mainly from an Open University course. I learnt HTML and JavaScript from a book, and CSS, xHTML and how to write better markup online.
Mon 08/11/04 at 16:08
Regular
"NULL"
Posts: 1,384
I learnt everything through web based tutorials and trial and error. I used the PHP manual a hell of a lot. I don't have any web or programming related books actually. Maybe should get some.
Mon 08/11/04 at 16:00
Regular
"Devil in disguise"
Posts: 3,151
cjh wrote:
> I'm getting the impression that people think SQL and
> mySQL are rivals, but this isn't the case.
>
> SQL, Structured Query Language, is a
> database syntax language used to standardise the way a database is
> connected to. The hope was that all database would use this same
> syntax so that developers wouldn't have to be concerned with learning
> new syntax when converting to new database applications. When you
> write the syntax to add a row of data to a table, that should work
> with any database that understands the SQL syntax.
>
> mySQL is a database application, much like Microsoft Access or
> Oracle. It stores and manages your data for you, but uses SQL
> syntax to allow you to access and alter that data. The name
> mySQL comes from the use of SQL syntax, not as a rival
> database.
>
> mySQL isn't designed with a graphical front end like Microsoft
> Access, so you have to enter the SQL commands manually.
>
> Programs such as mysql-front and phpMyAdmin were put
> together to create a graphical front end for users, and creates the
> SQL syntax for you.
>
> Well, I'm not sure if that above made much sense, as I'm half asleep
> here, so in summary, SQL is just a language, while
> mySQL is a database application/software/program that makes
> use of the SQL syntax (hence the name).

All very interesting, but totally irrelevant to what I said. ;)
MySQL supports a type/version of SQL, not the SQL standard, hence my original assertion.
Mon 08/11/04 at 15:21
Regular
"Picking a winner!"
Posts: 8,502
Did any of you guys who know a fiar bit of php use any books or was it all web based tutorials and examples?

Looking for anything that might make the learning a bit quicker.
Sat 06/11/04 at 14:53
Regular
"Picking a winner!"
Posts: 8,502
Cheers, thats what it is. Its an old tutorial so I'll just need to keep an eye out when working through it and find some more up to date sources just to check everything as I go.
Sat 06/11/04 at 14:09
Regular
"It goes so quickly"
Posts: 4,083
Try $_SERVER['PHP_SELF'] in place of $PHP_SELF.

PHP now comes with register_globals turned off by default, meaning that single variables for each value passed into a script are no longer created for you.

This also affects forms and query strings. Previously, when submitting a form, variables were created to match the name of each input element, and the value for that element would be stored in the created variable, for example:

name="username" /> - user entered Chris
name="password" /> - user entered 123abc

Once submitted PHP would see the name/value pair of username and Chris, along with the name/value pair of password and 123abc, and create the variables for you, like so:

$username = "Chris";
$password = "123abc";

With register_globals turned off now, that doesn't happen, instead each name/value pair is stored in a superglobal variable, such as:

$_POST['username'] = "Chris";
$_POST['password'] = "123abc";

It might be that the tutorials you're reading are simply out-dated. PHP, as an open source community, is continually updated and added to. The whole register_globals issue being on of the recent changes.
Sat 06/11/04 at 14:00
Regular
"Picking a winner!"
Posts: 8,502
Another couple of things. working through the webmonkey tutorials about using forms to add stuff to the database.

if ($submit)
Says the variable is undefined, which would be correct as there is no code to define it.

Also the code uses
printf("%s %s \n", $PHP_SELF, $myrow["id"], $myrow["first"], $myrow["last"]);

$PHP_SELF - when I submit the form I get a forbidden message and nothing is added to the database. Again undefined variable.

Are these predefined variables with a specific function that have a use in php and It's just not set up properly? Would expect the code on the tutorials to be correct.

For $PHP_SELF it says - This variable, which stores the script's name and location, is passed along with every PHP page.

Anyone know why its not working
Anyone help please
Sat 06/11/04 at 12:49
Regular
"It goes so quickly"
Posts: 4,083
AliBoy wrote:
> I'm not sure whats different between SQL and mySQL.


Pandaemonium wrote:
> Very Little. MySQL is opensource. It's not as advanced as say Oracle,
> but other than that I can't say.

Garin wrote:
> If you've done SQL before you'll be pretty comfortable with MySQL,
> syntax is pretty much identical, except when you move into more
> advanced stuff.


I'm getting the impression that people think SQL and mySQL are rivals, but this isn't the case.

SQL, Structured Query Language, is a database syntax language used to standardise the way a database is connected to. The hope was that all database would use this same syntax so that developers wouldn't have to be concerned with learning new syntax when converting to new database applications. When you write the syntax to add a row of data to a table, that should work with any database that understands the SQL syntax.

mySQL is a database application, much like Microsoft Access or Oracle. It stores and manages your data for you, but uses SQL syntax to allow you to access and alter that data. The name mySQL comes from the use of SQL syntax, not as a rival database.

mySQL isn't designed with a graphical front end like Microsoft Access, so you have to enter the SQL commands manually.

Programs such as mysql-front and phpMyAdmin were put together to create a graphical front end for users, and creates the SQL syntax for you.

Well, I'm not sure if that above made much sense, as I'm half asleep here, so in summary, SQL is just a language, while mySQL is a database application/software/program that makes use of the SQL syntax (hence the name).
Fri 05/11/04 at 17:00
Regular
"Picking a winner!"
Posts: 8,502
Thanks for the info.
Much appreciated.

Tutorials made everything much simpler and the mysql stuff is fairly similar to stuff I'd done before which is good to know. Just need to get php mastered in a short time :-)
Fri 05/11/04 at 15:04
Regular
"Lisan al-Gaib"
Posts: 7,093
Nimco wrote:
> phpMyAdmin is a very powerful, web-based database administration tool.
> You can view/edit database/table structures, as well as modify table
> data. Depending on priveleges, you can also do things like modify
> user rights and things.

Thaks for bringing that to my attention. Excellent pience of software. Confusing at first glance yeas, but it looks like the mutts nuts.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

I am delighted.
Brilliant! As usual the careful and intuitive production that Freeola puts into everything it sets out to do. I am delighted.
Wonderful...
... and so easy-to-use even for a technophobe like me. I had my website up in a couple of hours. Thank you.
Vivien

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.