Hi,
How can I query a database in another php file where the variable I want to
query is referenced on another page?
Ex.
$LinkName is on File A
on File B I want to do this
$sql = ( "SELECT Email from Listings WHERE Company LIKE '$LinkName'"
$result = mysql_query($sql);
$row = mysql_fetch_row($result);
$emailvar = $row[0];
When I do this, it gives me an error "0 is not a Mysql index......" I tried
using include() but doesn't work too. Actually, File B is called by this
code,
print '<FORM NAME="email" METHOD=POST ACTION="fileb.php3">
<INPUT TYPE=HIDDEN NAME="PHORM_CONFIG" VALUE="feedbackconfig.inc">
<INPUT TYPE=HIDDEN NAME="PHORM_NOTHIN" VALUE=" -- ">
<INPUT TYPE=HIDDEN NAME="ph_sneak" VALUE="Boo!">';
Any ideas?
Phutie
How can I query a database in another php file where the variable I want to
query is referenced on another page?
Ex.
$LinkName is on File A
on File B I want to do this
$sql = ( "SELECT Email from Listings WHERE Company LIKE '$LinkName'"
$result = mysql_query($sql);
$row = mysql_fetch_row($result);
$emailvar = $row[0];
When I do this, it gives me an error "0 is not a Mysql index......" I tried
using include() but doesn't work too. Actually, File B is called by this
code,
print '<FORM NAME="email" METHOD=POST ACTION="fileb.php3">
<INPUT TYPE=HIDDEN NAME="PHORM_CONFIG" VALUE="feedbackconfig.inc">
<INPUT TYPE=HIDDEN NAME="PHORM_NOTHIN" VALUE=" -- ">
<INPUT TYPE=HIDDEN NAME="ph_sneak" VALUE="Boo!">';
Any ideas?
Phutie