Jump to content

What is SQL?...


Fmdpa

Recommended Posts

SQL is a language for quering database. To "query" means to create, append, edit and remove stuff, with the SQL terms being respectively CREATE, INSERT, ALTER (or UPDATE, depending on the context) and DELETE.MySQL is a database engine that uses SQL as a way to let the user query data in it. There are other database engines that use SQL too, such as MSSQL, PostgreSQL, Oracle, etc.PHP, among other things, can be a MySQL client. In other words - something which sends SQL queries to MySQL. There are other SQL clients, not just PHP.

Link to comment
Share on other sites

SQL (structured query language) is the language you use to interact with a database. MySQL is a database management system. You use the SQL language to send queries to the MySQL database to work with the data. SQL is separate from PHP, the only relation they have is that you can use PHP functions to send SQL commands to a MySQL database (or other database).

Link to comment
Share on other sites

It's worth pointing out, though, that the Apache software that runs a HUGE proportion of webservers is typically bundled with mysql and PHP. This gives rise to the frequent use of the acronyms LAMP, WAMP, MAMP and a few others, which refer to configurations of Apache-Mysql-PHP/Perl/Python running on Linux, Windows, or Macintosh platforms. Chances are excellent, in fact, that if you rent server space, your host is configured as a LAMP.

Link to comment
Share on other sites

That's actually something else I was interested in. This probably is pushing into PHP, but here it is. First, how do I protect just certain elements on a page depending on whether the user is logged in (instead of protecting entire pages)? Also, I want to make a personal lightbox for each user (that would be the purpose of registration). Each user, therefore, would have a "lightbox.php" page, containing the images they've added to the lightbox. Of course this would be dynamic (different for each user), so how would that be done?

Link to comment
Share on other sites

First, how do I protect just certain elements on a page depending on whether the user is logged in (instead of protecting entire pages)?
You would just surround the output that defines the section you want protected inside a conditional, which checks to see whether the user is logged in (through sessions, etc.).
Also, I want to make a personal lightbox for each user (that would be the purpose of registration). Each user, therefore, would have a "lightbox.php" page, containing the images they've added to the lightbox. Of course this would be dynamic (different for each user), so how would that be done?
You'd have a querystring (GET) variable that defines what user lightbox.php should show, and then request data from the database using that id. E.g. lightbox.php?user=4, and then SELECT * FROM images WHERE user = 4.
Link to comment
Share on other sites

Ok, I'm trying to add SQL support onto my computer. It is already running Abyss Web Server with PHP support added. From what I understand, it would be easiest to install phpMyAdmin for something like this. I downloaded this from MySQL: http://www.mysql.com/downloads/mysql/. But I can't get it the SQL server started. Therefore, I can't move onto the next step and install phpMyAdmin. Any suggestions? Maybe switch to a new web server...? (even though I'm only using it for the http://localhost "network")

Link to comment
Share on other sites

The best ("correct" is not a correct way to put it - every choice is correct for certain circumstances) choice is the one that is NOT just "essentials", that is an MSI installer, that is a GA release, that is your OS (I'll assume you're using Windows; If that's not the case, please say what it is), and which is the same bits as your OS (32 or 64). The bit part is not critical, so if you're unsure, go with the 32 bit version.In other words - mysql-5.1.47-win32.msi, or if you know for sure you're using a 64 bit version of Windows - mysql-5.1.47-winx64.msi.To install it, you just start the MSI installer and follow the instructions. If there are any error messages, ask again, so that we may find out why they're happening.

Link to comment
Share on other sites

I installed the latter MySQL download, since I am using Windows 7 64-bit. The install seemed to go very smoothly, but then I couldn't get the server started. I was able to start the mysql command line, but no green light. Following a tutorial I saw, I started the bin/mysqladmin.exe file, but still no green light. I didn't go any further in the phpMyAdmin installation, since I couldn't get the mysql server started.

Link to comment
Share on other sites

Do you have XAMPP, WAMP or something similar? If so, they include MySQL, so the one you're downloading and installing yourlself won't work, because the included one has already taken over.If you don't, first try to right click on MySQL and tell it to "Run as Administrator" (I recall having a similar problem with MySQL without doing it like that...).If that doesn't work, uninstall the whole thing - Apache, MySQL, PHP... everything. Start over.Try a tutorial like this one. Very detailed. A little outdated, but it is still applicable. You can skip step 2 if you already have another archiving program.

Link to comment
Share on other sites

I decided to do the whole reinstall thing.I got to the third step (Apache started fine; skipped step #2). I changed all the docs the way the tutorial said, and it gave me a 403 error page:"Access is forbidden to this page: /php/php-cgi.exe/", or something like that.

Link to comment
Share on other sites

Like the comments in the tutorial say, Ed has missed to mention that you also need to give Apache access to the PHP folder, with something like:

<Directory "C:/php">	AllowOverride None	Options None	Order allow,deny	Allow from all</Directory>

This says that .htaccess files are not enabled in this folder, and neither are any special server treatments, but (read) access is allowed to everyone.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...