User Guide
Outlined below is a description of each of the functions
available within the Mini SQL module.
msqlConnect ( )
char *host
Example :
if ($sock < 0)
{
echo("ERROR : $ERRMSG\n");
}
int sock
Example :
int sock
char *db
Example :
{
echo("ERROR : $ERRMSG\n");
}
int sock
char *query
Example :
{
echo("ERROR : $ERRMSG\n");
}
Example :
int res
Example :
int res;
Example :
if ( # $row == 0)
{
echo("ERROR : $ERRMSG\n");
}
else
{
echo("Field 0 is $row[0]\n");
}
int res
int location
Example :
int sock
Example :
$index = 0;
while ($index < # $dbs)
{
printf("Database = %s\n", $dbs[$index]);
$index = $index + 1;
}
int sock
char *db
Example :
$index = 0;
while ($index < # $tabls)
{
printf("Table = %s\n", $tabls[$index]);
$index = $index + 1;
}
int sock
char *db
char *table
msqlListField ( )
|
|
|
Field Name |
|
Table Type |
|
Type |
|
Length |
|
Flags |
Example :
$field = msqlListField($res);
while( # $res 0)
{
echo("Name $field[0]\n");
$field = msqlListField($res);
}
int res
int location
msqlNumRows ( )
int res
Example :
$res = msqlStoreResult();
printf("There are %d rows in foo\n",
msqlNumRows($res);
char *string
Example :
$newName = msqlEscape($name);