I'm renovating my website, and I've decided to use MySQL in conjunction with PHP.
The way I'm doing this is storing articles/scripts/etc in tables in my SQL database, and running a query from the file "viewarticle.php", with a $_GET variable called 'id', so basically you put "http://near.zxq.net/viewarticle.php?id=1234" and it takes the variable 'id' and checks it against the data in the Id column of the table.
The code I'm using for the query is:
and the error I'm getting is in the $query variable.
Apparently it doesn't like for me to use String + String to concatenate them for an SQL query...
Is there a way to do this?
The way I'm doing this is storing articles/scripts/etc in tables in my SQL database, and running a query from the file "viewarticle.php", with a $_GET variable called 'id', so basically you put "http://near.zxq.net/viewarticle.php?id=1234" and it takes the variable 'id' and checks it against the data in the Id column of the table.
The code I'm using for the query is:
Code:
$query = 'SELECT * FROM <table> WHERE Id = '+$_GET['id'];
$result = mysql_query($query);
and the error I'm getting is in the $query variable.
Apparently it doesn't like for me to use String + String to concatenate them for an SQL query...
Is there a way to do this?