How do you work a SQL code, I would like to know.
What i mean by this is like with a search engine, they use the SQL that just opens everything in thier database. How would i do it, 'cause I am going to eventually make a forum, I hope.
-CP
The views expressed on this page by users and staff are their own, not those of NamePros.
There's a lot that you need to know when talking about SQL; In my opinion, my importantly security.
Depending on what SQL database you want to use (I assume for mainstream web projects - MySQL) and what programming language you prefer (for me, it's PHP), you can find a variety of resources on development sites. If you're not interested in those that I listed above, you can search "[language] [database] resources". If you're interested in the conbination that I listed above, look below.
Basically, you issue, then you get the results to maniuplate.
something like this:
PHP:
$sql = "select * from table where lastName='lastname'";
$result = mysql_query($sql);
Queries can returm multiple rows. You can then loop through them like this:
PHP:
while($row=mysql_fetch_array($result)) {
# $rowis an array with the field names as the array indices.
echo "Last Name: $row[lastName]<br>";
echo "First Name: $row[firstName]<br>";
}
THis example is over simplified. As STSCAC suggests, you will need to doa bucnh of reading up on this subject.