Just trying to paste some values using php's "echo" and am having bad luck with it.
I belive that the code I am using is problematic in its first variable setup "$theid", where it grabs the id field from a table. Here's the code:
<?php
$conn=mysql_connect("localhost", "username", "password")
or die ("Cannot Connect to MYSQL");
mysql_select_db("database1", $conn)
or die ("Cannot Connect to the Database");
echo "Connected successfully";
$theid = isset($_GET['id'])?$_GET['id']:""; //Possible problematic code
$data = mysql_fetch_array(mysql_query("SELECT * FROM table1 WHERE id='$theid'"));
?>
The data would then be used:
<?php echo $data['url'] ?>
Problem is, nothing is displayed under "$data"
After troubleshooting this and looking around on SO, I am still yet to find an answer. Any feedback is highly appreciated, I'm sure this is just an error with my use of syntax!. Thanks.