Hello, I know how to select an actual category or field in the database in a table and to pull its row. I just don't know how to access a field based on the name it is.
In the below code of how far I am with this, the urlname is a web site name that will be entered through a form. The name of the table is getdata. In the database will be a web site name such as php builder or whatever. Then in the php builder field I will have data inserted into the php builder row. So-
<?
$conn = mysql_connect('mysql1', 'testthis', 'password');
$db = mysql_select_db("testthis");
$url = mysql_real_escape_string($_POST['urlname']);
$query = "SELECT $url from getdata Limit 1";
$result = mysql_query($query) or die(mysql_error());
I can piece the rest together from here.
?>
I don't know how to say "select the particular field in the table that matches the web name that is inserted into the form." The query doesn't seem to take the variabe $url as is. Thank you very much.
Or
$query = "SELECT ???? from getdata where ???? = '" . $url . "';";