Hi all
I have the following table
Code: [Select] `date` date
`day` int(2)
`month` int(2)
`year` int(4)
If I pass a date range in PHP, such as
Code: [Select]$datefrom = '2009-02-20';
$dateto = '2009-02-25';
How can I get it to INSERT a record for every date between that date range?
So with that example date range, it would do
Code: [Select]INSERT INTO `dates` (`date`, `day`, `month`, `year`) VALUES
('2009-02-20', '20', '02', '2009'),
('2009-02-21', '21', '02', '2009'),
('2009-02-22', '22', '02', '2009'),
('2009-02-23', '23', '02', '2009'),
('2009-02-24', '24', '02', '2009'),
('2009-02-25', '25', '02', '2009')
but not do an INSERT if any of those dates already exists in the database.
Any help would be great
Thanks
Displaying a clickable playername
I am going wrong somewhere with the mysql_query, can someone please put me straight?$playername = mysql_query("SELECT * FROM `players` WHERE `playername` LIMIT 1");while($f =
Call db table from any PHP file
Hi,I want to be able to call a database table that will be setup in another file called init.php, and be able to call it from any PHP file that has init.php included.Table is called abc_offline and
Help building / using array
First - this is a cross-posting, if this is wrong I apologise! What started out as a MySQL query question (original post http://www.phpfreaks.com/forums/index.php/topic,273323.0.html) has become a PHP
try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called "a"Code: private function fileOpenMethod($filePath,
xml element exists
Code: [Select]<?xml version="1.0"?><Addresses> <Address ID="1"> <Address2>101 MAIN ST</Address2>
Email with Attachments in PHP
Hi Friends How to send email in PHP with attachment.I know simple mail can be sent with mail() function but i have no idea about email with attachment.
help with insert
Hi there,I am trying to insert some data into a database, but for some reason, it is not inserting.Can anyone see anything wrong with my code:<?php$host = "***";$username =
Form help: Syntax & Logic
Hello again all,I'm working on a form and ran into a wall (again) and can't seem to think through how to best code what i need (the logic side). I've begun by just sitting down and starting to code
Logic question
im wondering what's the best method to do the above list:it is for alliance @ MMORPG game -the administrator of alliance have 10 slots for creating ranks ... each rank have it's own permissions (in
Am I setting up my sites oldschool?
Ok,When I create a site I open a basic template that I have created that consists of a css file an index page and a few php inserts for the header, nav and footer.It works fine and I am happy with it