How to Select
| From: | John Taylor-Johnston | Date: | Fri, 15 Aug 2003 05:30:28 +0000 |
| Subject: | How to Select | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-159640@lists.php.net to get a copy of this message | ||
Ok, this is a basic MySQL question, but I don't know how to code it in PHP. I want to check in
StudentId. If it exists, ...
Anyone good humoured who would help me fill in the blank. Like I should know this, but haven't
even thought of coding SQL in a while :)
$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);
$news = mysql_query("select StudentId $table");
while ($mydata = mysql_fetch_object($news))
{
}
if exists
{do this}else{do that}