Is their a way you can access a MySql >Update:
How can I make a web page that will accept incoming request commands, and then make that page return mysql data instead of connecting directly to a MySql database.
Copyright © 2024 VQUIX.COM - All rights reserved.
Answers & Comments
Verified answer
Well it needs to connect to the database directly in order to retrieve data there is no such thing as a partial connection. You need to validate the request.
<?php
$host = "";
$username = "";
$password = "";
$DB = "";
mysql_connect($host, $username, $password)or die(mysql_error());
mysql_select_db($DB)or die(mysql_error());
$TB = "";
$sql = "SELECT usernames FROM $TB";
$result = mysql_query($sql);
$count = mysql_num_rows($result);
if($count > 0)
{
$r = 0;
while($r < $count)
{
$field0=mysql_result($result
,$r,"usernames"); //This line should join the line above
echo $field0;
echo "html br tag goes here";
}
}
else
{
echo "0 rows found";
}
?>
should echo a list of usernames from a table. However all the variables I have left blank as they are your details and I'm not aware of your details. Fill these in correctly and it should return a list of results.
all databases send data back... that's what they do... i don't understand your question! all dynamic websites request info from the database and it gets sent back, usually the info which helps the database find the correct info is in the form of a hidden field, querystring, or session state