Your Ad Here

 Navigation

Home
Source code
Tutorials
RSS feeds
Articles
Books
Software
Downloads
Hosting
manuals
Forums
Script directory
Training
Our Links

 Sponsors
 Links
programmershelp
software directory
golfing products
 Downloads
 Misc

Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming


A daily MySQL row displayed

A daily MySQL row displayed

//database can be found at http://programmershelp.co.uk/mysqldatabase.php

<?php
//use the getdate function to retrieve the date/time data
$today = getdate();
//store the day of the week in the $day variable
$day = $today['wday'];
//increment the variable by 1 because the wday returns 0 to 6 to represent Sunday to Saturday
//Our database ID starts at 1
$day = $day + 1;
//connect to server with username and password
$connection = mysql_connect ("localhost","root", "") or die ("Cannot make the connection");
//connect to database
$db = mysql_select_db ("test",$connection) or die ("Cannot connect to database");
//our SQL query we will display the id equivalent to the $day variable
$sql_query = "SELECT * FROM test WHERE id LIKE $day";
//store the SQL query in the result variable
$result = mysql_query($sql_query);
if(mysql_num_rows($result))
{
//output as long as there are still available fields
while($row = mysql_fetch_row($result))
{
echo ("<a href=\"$row[2]\">$row[3]</a>");
echo (": $row[4]<br>");
}
}
//if no fields exist
else
{
echo "no values in the database";
}

?>







Books
 Sponsors
 Random Code
strip out certain tags(string)

hexadecimal to decimal conversion(math)

create a database(database)

 Random Article
  Network

Programming resources
Tutorials directory
General bid directory
sell software, make money
Find me wholesalers
Find me dropshippers
Free recipes online/a>
UK products and price comparison
Anime videos
Free lyrics search
free stuff
UK stores
Gambling directory
Sexy free wallpapers
Hosting resources
ASP site
Golf resources
iPod resources
Coupons and deals
Baby names
Domain names
Dating site
Scripts directory
Maxi directory
bigarticle : free articles
dawgwitch search
List of directories






beginners PHP Copyright © 2004 onwards by beginnersPHP.