PDA

View Full Version : MySQL - Quick Questions



sean
08-31-2003, 03:05 PM
1) If someone has MySQL on their computer, and runs a client from another computer (the files (PHP in this case) are stored on the same computer as all the MySQL information), does the client need to specify a host to connect to?

2) How do you add and retrieve binary file (i.e. blob) to/from a table? The book I''m learning from is very inconsistent in this area.

FloatingPoint
09-01-2003, 01:39 AM
1
To connect to the server, you'll usually need to provide a MySQL user name when you invoke mysql and, most likely, a password. If the server runs on a machine other than the one where you log in, you'll also need to specify a hostname. Contact your administrator to find out what connection parameters you should use to connect (that is, what host, user name, and password to use). Once you know the proper parameters, you should be able to connect like this:

shell> mysql -h host -u user -p
Enter password: ********


More info HERE (http://www.mysql.com/doc/en/Connecting-disconnecting.html)

2
3.3.4 Retrieving Information from a Table

The SELECT statement is used to pull information from a table. The general form of the statement is:

SELECT what_to_select
FROM which_table
WHERE conditions_to_satisfy;
what_to_select indicates what you want to see. This can be a list of columns, or * to indicate ``all columns.'' which_table indicates the table from which you want to retrieve data. The WHERE clause is optional. If it's present, conditions_to_satisfy specifies conditions that rows must satisfy to qualify for retrieval.


More info HERE (http://www.mysql.com/doc/en/Retrieving_data.html)

Hope this would give you some lead :)

sean
09-01-2003, 09:40 AM
The first one did, thanks. The second one? I know how to get regular data from a table but apprently the method for getting blobs (binary files) out is different. hanks for the info on the first one though. Anyone know about #2?