所以基本上我正在尝试编写一个 php 脚本,该脚本可以上传到服务器并位于我网站上的某个位置以单击。然后当它被点击时,它会运行 mysql 查询并显示所需的信息......这就是我到目前为止所拥有的。
--Connect.php--
$dbhost = 'localhost';
$dbuser = '******';
$dbpass = '******';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die
('Error connecting to mysql');
$dbname = '*****';
mysql_select_db($dbname);
?>
--我需要运行php文件的mysql命令是
SELECT jsfdName.baseData AS Name,
jsfdAddr.baseData as Address,
jsfdZip.baseData AS Zip,
jsfdCity.baseData AS City,
sfdCounty.baseData AS County,
jsfdState.baseData AS State
FROM jos_sobipro_field_data AS jsfdName
JOIN jos_sobipro_field_data AS jsfdAddr USING( sid )
JOIN jos_sobipro_field_data AS jsfdZip USING(sid)
JOIN jos_sobipro_field_data AS jsfdCity USING(sid)
JOIN jos_sobipro_field_data AS jfsdCounty USING(sid)
JOIN jos_sobipro_field_data AS jfsdState USING(sid)
WHERE jsfdName.fid = 36 AND jsfdAddr.fid = 37 AND jsfdZip.fid=38 AND jsfdCity.fid = 39
AND jsfdCounty.fid = 40 AND jsfdState.fid = 41 AND sid > 329
那么如何编写 php 脚本来在我的网站中运行这个文件呢?
谢谢