PHP Array Looping using data from MYSQL
Posted on 2007-04-02
how can i handle data from a table in mysql with php
i have a connection to a database
and i want to have a query that returns set number of records with 5 fields.
ID, Title, Article, Link, Picture
i then want to use these records on my page.
Picture - Title
i have wrote the following but don't seem to be getting very far on writing a loop to print the data on the page
$sql = 'SELECT ID, Title,Article,Picture,Link FROM tblArticles LIMIT 10';
$result = mysql_db_query($db1, $sql) or die ("Could not execute query");
$row = mysql_fetch_array($result);