The script below is intended to read a database record from "MySQL-db" from a webquery http://mydomain.com/article.php?ArticleID=?? and echo the result to the screen.
I'm not fully certain that the script is connecting to MySQL_db and it is not returning any result.
MySQL _db is set up correctly with data in it. I can access it via a MySQL workbench so i'm pretty sure my script syntax below is wrong.
Code: Select all
<?php
// this is articles.php
// reads an database record from MySQL_db
//and echos the result to the screen
mysql_connect("localhost", "mysql_userid", "mysql_password");
// open the mysql db where the articles are stored
mysql_select_db("mysql_db");
$ArticleID = $_GET['ArticleID'] ;
$result = mysql_query("SELECT Articles.ArticleID, Articles.Article FROM Articles WHERE ArticleID='$ArticleID' ");
echo "<p align=justify>";
printf(" %s<br>\n", mysql_result($result,0,"Article"));
echo "</p>";
?>
thanks