Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql in php

Status
Not open for further replies.

kpdvx

Programmer
Dec 1, 2001
87
US
i want to use this from php, how do i?

SELECT
str_name_first
FROM
set01
WHERE
UPPER(str_name_first) LIKE 'florence';
 
This should work:
$connection = @mysql_connect($host, $user, $password);
@mysql_select_db($database);
$result = mysql_query("SELECT str_name_first FROM set01 WHERE UPPER(str_name_first) LIKE 'florence'");
while ($row = mysql_fetch_array($result))
{
foreach ($row as $column)
echo $row . "\n";
}
mysql_close($connection);
where $host is the name of the computer where the mysql server is, $user is the username used to connect to mysql, $password is the password used for that user and $database is the database to get the info from. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top