Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Inserting A Date Into A Microsoft Access 97 Database


I was wondering if anyone could help me insert a short date into microsoft access 97 using php? i can insert text no problem but i can't seem to be able to insert a date properly. i have been using

//$date = "#" . "$sqlmonth" . "1" . "$cboyear" . "#";

$strSQL = "INSERT INTO tblSupport (tDate) VALUES ($date)";
$result = odbc_exec($connect, $strSQL);

Note: i can insert a date if i hard code it like putting in #01




View Complete Forum Thread with Replies

Related Forum Messages:
Inserting Records Into A Microsoft Access Database...
I'm still new at using PHP although thanks to these forums I'm learning quite a lot. Currently, I am trying to insert a new record into my access database.

I can display records from it but not add new ones. I know that I am to use the 'INSERT' SQL function but how would an Access Database be different from mySQL?

So far I've seen only mysql examples and havent been able to find anything on access...

View Replies !
SQL Error: [Microsoft][ODBC Microsoft Access Driver] Too Few Parameters
I'm trying to execute the following SQL statement and get the following error.

SELECT DomainNames.DomainName FROM DomainNames WHERE DomainNames.DomainName Like "*ab*" ORDER BY DomainNames.DomainName

SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect

I'm running PHP4, Apache 1.3.12 (Win32) and connecting to an Access database on a Win2K box.

View Replies !
Odbc_exec(): SQL Error: [Microsoft][ODBC Microsoft Access Driver]
i am trying to write to the database through odbc. i get the following error:

Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in c:inetpubwwwroot514VIP_SurveyProcess.php on line 41

my directory has read/write permissions why am i getting this? here is the code as an example:
...
$x = 10;
$querySet = "UPDATE Survey SET $rdoOption = $x";
odbc_exec($objConn, $querySet);
...

View Replies !
Inserting Date Into Database
I have a pretty simple news code that inserts the data, and then is retreaved, with a pretty simple scheme. I have a date column set at timestamp(14), and I'm trying to insert NOW() as the date. I browse with phpmyadmin and all it has is 14 zero's. PHP Code:

View Replies !
Inserting Date In Database
I have form which allows a user to select a date as part of the form.
On submitting i am getting no update to the database and no error message.
To try and test it i created a shorter version which sets up the variables except the date.This gives the same result.ie no update. Code:

View Replies !
Can PHP Access Microsoft Access Databases?
Can PHP access Microsoft Access databases? Are there any basic scripts, any good sites out there? I just want to extract simple data from a table and display it on a webpage...as basic as can be to start.

View Replies !
Convert User Entered Date And Time To Unix Timestamp Before Inserting To Database
How do you convert a user inputted date to a unix timestamp before
insterting it into your database? I have a form, with a textfield for
a date that the user inputs in the format mm-dd-yyyy and three dropdow
boxes for hours, minutes, and AM/PM. All of these need to be considered
together and converted to one Unix Timestamp and then inserted to the
MYSQL date field. The type of field is INT (11) so that I can instead
of the standard 0000-00-00 format of MYSQL so that I can do better
calculations and queries.

View Replies !
Insert A Simple Date Into An Access Database Using Php
i am trying to insert a simple date into an access database using php. my code looks liek this: PHP Code:

$today = date('m/d/Y');
$conn=odbc_connect('DVDLobby','','');
$sql="INSERT INTO tblDVD (PurchaseDate)
VALUES($today)";
$rs=odbc_exec($conn,$sql);

and it works but when i open up the db in access and look at the record that was inserted, thePurchaseDate field is 12:00:22 AM instead of 01/06/2006.

View Replies !
PHP And Microsoft Access
Is it possible to use php to interface with an ms access database?

Our current database (customers, suppliers etc) is in ms access format and we need to run msaccess. I dont feel like converting the whole database over to mysql and we still need the original system, the idea will be that the staff can access the database on the road thru a webpage.

View Replies !
Microsoft Access
I wanted to find out if any of you know the odbc equivalent to mysql_query I'm using a Microsoft Access DB and need to insert values into a table ex.

mysql_query("insert into cart(cookieId, MaterialListID, qty) values('" . GetCartId() . "', $MaterialListID, $qty)");

View Replies !
Exporting To Microsoft Access
I have a PHP website with a mySQL database and a client wants to be able to see the database on his computer using Microsoft Access.

I would like to be able to make a special backdoor section for him, where he enters his username and password and is given a link which will make take a snapshot of the mySQL database and convert it to a Microsoft Access database which he can download to his computer.

Is this possible?

Since he isn't very computer savvy I need a way as user friendly as possible to let him download the database and view on his local computer.

View Replies !
Microsoft Access -> PhpMyAdmin
Alright, so what’s going on is that I have coded an entire website with in mind to have an Access Database. So everything works great...

But now I am faced with the problem that I have to have my webpage work with phpMyAdmin, which works completely differently in running my sql statements and everything, ie: ->EOF, select statement, etc...

Is there a way for me to have a smooth transition for my code to work with phpMyAdmin instead of Access at the moment, because recoding all of this means an enormous amount of work with not much free time left on my hands. Code:

View Replies !
DB's With Microsoft Access
Is it possible to create database that comply with PHP in Microsoft Access?

View Replies !
Microsoft Access Query
We are trying to select a record from a Microsoft Access database and display it on a PHP page on our site.

View Replies !
Microsoft Access Dropdown List
l am building a new site using PHP which has a lot of pages pulling from an Access Database. I would like to have a dropdown list that pulls exhibitions from the database and then when the user selects one it shows the rest of the details from DB just below the dropdown list, hope that makes sense. Code:

View Replies !
Insert Into Microsoft Access Table Using ODBC
The following lines of code don't return an error but they also do not insert the row into the database:

$SQLText="Insert into member (MailingID, MemberID, [File As], EMail, LetterID, AudienceID, DateSent, Sent) Select $MailingCode, $row[0], '".$row[5]."', '".$row[6]."', $LIDToInsert, $AIDToInsert, '".$DateSent."', 1;";

print '<br>'.$SQLText;

$rs_upd=odbc_exec($link, $SQLText);

if (!$rs_upd) die("Couldn't update database");

I've tested the resulting $SQLText string in Access directly and it works find there so this must be a PHP or ODBC issue.

View Replies !
Use A Microsoft SQL Database Using PHP Compared To MySQL?
I have only ever used MySQL with PHP but have been asked by a cleint if I would be able to develop a website and import data from an existing database that is updated by bespoke software that they have purchased and runs on their desktop machines (but the database is on a remote server). I guess what I am asking is how easy is it to use a Microsoft SQL database using PHP compared to MySQL?

View Replies !
Convert The Date Separator Before Inserting The Date Into The DB
I need to convert the date separator before inserting the date into the DB. Right now, I have 01/01/2006 and I want 01-01-2006. The dates are coming from a CSV and so are an array element. I've tried strrpos and a few other functions trying to just replace the slashes with hypens and that's not working (I think maybe because it's an array and those functions don't work on arrays?) Could someone post example code for something like this?

I have an array called $items[3] that holds the date with the separator mentioned above. I'm sure there are several ways to do it in both php and with mysql functions but I've been stuck on it for a while and REALLY need to get through this for a project I'm working on right now.

View Replies !
Microsoft JET Database Engine Error '80040e10'
I am new to ASP, I am trying to create a page using ASP that will read from a database and write to my page, but I get this error every time: Microsoft JET Database Engine error ?e10' No value given for one or more required parameters.

View Replies !
Access The Primary Key While Inserting A Record
Is there a way to reference the 'primary key' field of a record you
are actually inserting at the moment.

Im using an 'int auto increment' field as the primary key.

I could reference it with a select statement and adding a 1 to the
last record's primary key. However, there must be a better way to do
this - what if someone adds a record right after I reference the last
one.

View Replies !
Warning: (null)(): Invoke() Failed: Exception Occurred. Source: Microsoft JET Database Engine Description:
the code below the sql execute that uses $sql99
does not work while the one with $sql2 works. $sql99 is exactly the same as
$sql2 when printed out.

I get an error saying:
Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft
JET Database Engine Description: Syntax error in INSERT INTO statement. in
c:phpwebcommit.php on line 91

Here is the code:

<?PHP

// PHP db connection
$db = 'C:Phpweb est.mdb'
$conn = new COM('ADODB.Connection') or die("Cannot start ADO");;
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db");

import_request_variables(gp, "");

$filetitle = "";
$form_fields = array_keys($_GET);

//$sql = "INSERT INTO Cards(";
$ids = "";
$values = "";

for ($i = 0; $i < sizeof($form_fields); $i++) {

$build_sql = 1;
$thisField = $form_fields[$i];
$thisValue = $HTTP_GET_VARS[$thisField];

// check defualt values and change them to blank
if($thisValue == "insert approval #" || $thisValue == "insert file #")
$thisValue = "";

// concatinate file number
if($thisField == "filetitle_1"){
$filetitle = $filetitle . $thisValue . " ";
$build_sql = 0;
}
if($thisField == "filetitle_2"){
$filetitle = $filetitle . $thisValue . " ";
$build_sql = 0;
}
if($thisField == "filetitle_3"){
$filetitle = $filetitle . $thisValue . " ";
$build_sql = 0;
}
if($thisField == "filetitle_4"){
$filetitle = $filetitle . $thisValue;
//echo "filetitle" . " = " . $filetitle . "<br>";
$build_sql = 0;
$ids = $ids . "filetitle,";
$values = $values . "'" . $filetitle . "'" . ",";
}

View Replies !
Inserting Date
This seems really simple, but I still couldn't figure it out. I set my field to type "Date" with default of "0000-00-00". Then I tried using PHP to insert the current date, but it wouldn't write and stay as "0000-00-00". Here is my code: PHP Code:


$insert = mysql_query("INSERT INTO registration VALUES ('', '$cusid', '$eid', '$sneed', 'date(y-m-d)')", $db);

I also tried to use now() and it didn't work either.

View Replies !
Inserting Date & Time
I am using now(), but I'd like to use strftime("%d. %B %Y %R"). I can't for the life of me figure out how to use strftime("%d. %B %Y %R") in the code below without it failing.

The other issue is that both now() and strftime("%d. %B %Y %R") return 9/27 as the date. But it's 9/28.  How can get it to return the correct date? I thought the setlocale would address this. Code:

View Replies !
Inserting Current Time/date.
I am trying to insert the current date/time into a MySQL table field when a record is inserted, however i cannot get it to work. My PHP is basically like this:-

$sql = "INSERT INTO Table (ref,title,first,surname,telephone,mobile,ila,ila_date,status)
VALUES ('$ref','$title','$first','$surname','$telephone','$mobile','$ila','NOW()','$status')";

The field called "ila_date" is where i want to add the current date/time. Ive read about the NOW() function, but i think im useing it incorrectly. My MySQL table column "ila_date" is of type timestamp(14).

View Replies !
Date Format When Inserting Data
I am getting a date entry through POST by a form byt the format enetered by the user is 'dd/mm/yy' .... how could i use MYSQL PHP syntax to insert the proper format as it is default in the table in my database. which function is it?

View Replies !
Format For Inserting Into Mysql Either In DATE Or TIMEDATE
i've got a date coming into my webstite in the format:

HH:MM:SS DD Mmm YY,YYYY PST (looks like 4:29:05 Aug 23, 2007 PDT)

but I want it to convert it into a format for inserting into mysql either in DATE or TIMEDATE,

i thought about using explode, but there explode takes everything seperated by a certain character, but how can it be done if there are 2 different characters?

View Replies !
Inserting Into A Database
how do I insert information from a from into seperate tables

View Replies !
Inserting To Database
i have one problem in my website. i have one registration page in which i have several text based fields and 5 upload fields...which will be images.

now what i have to do is that insert all the text based data to a table named product. the images should be inserted to a table named productimage. Code:

View Replies !
Inserting Into Database
I have a small problem which I've been working on for a while. PHP Code:

$query = "INSERT INTO tbl(username,ip,link) VALUES("Brin' . $result['id'] . '","$REMOTE_ADDR","http://www.domain.com/sub/start.php?username=Brin"' . $result['id'] . ' )";
mysql_query($query);

View Replies !
Inserting ' In To A Database
I've been having problems with a form I'm trying to insert in to a database. It borks if I try and insert any query with a ' in.

Basically, I have a form with two fields, one title and one content. They are passed to the database like so:

<?php  $q = "INSERT INTO ".TBL_NEWS." (title, content, username, timestamp) VALUES ('$title', '$content', 'Kemik', '$time')"; ?>

I do use stripslashes() on the variables and then check them via eregi however I'm not sure of any other way to ensure I can submit a sentence such as Why won't this thing work? without breaking the query and ensuring I can display it from the database on to a different php page the same way as I inputted it.

View Replies !
Inserting Data Into The Database:
I just don't get it, I have searched everywhere and can not find what I am doing wrong. I am familiar with SQL, but I typically use ASP, Access so this MySQL thing is very new. Here's my attempt at inserting data into the database:

// Connection Strings
$username = "-------";
$password = "-------";
$hostname = "localhost";
$dbConnect = mysql_connect($hostname, $username, $password) or die("Unable to connect to the Database, please try again.");
mysql_select_db("database1") or die(mysql_error());
$theSQL = "insert into table (Item1, Item2, Item3) values ";
$theSQL = $theSQL."('".$Item1."','".$Item2."','".$Item3."')"
mysql_query($theSQL, $dbConnect) or die(mysql_error());

I know my connection is good, the problem is with the mysql_query line. I've tried it with and without the $dbConnect and neither works. What am I doing wrong?

View Replies !
Database Inserting Problem
In the database i have 2 fields:

Subject type text
Content type text

My query is something like insert into table_name values ('$subject',
'$content'). These variables are taken using POST from a HTML formular.

the problem is that if i i write into the subject field from the HTML
page "Hello friend" into the database it's inserted only the first word
("Hello"); the same happens with content;

How to overcome this problem?

View Replies !
Wrong $id Inserting Into Database
I'm working on "user comments" for my forums and when someone clicks the users name to go to there profile the url will come up profile.php?id=whatever and the user comments are in the peoples profiles anyways after they submit there comment the insert the profiles id into the column 'id in the database but I don't want that I want the id just to rise in number from 1 to whatever when a user leaves another comment. PHP Code:

View Replies !
Inserting Array To Database
inserting array from form into database. But it give an 'no such index in string error'. I tried $bands[]=HTTP_POST_VARS[band]; and all it does is insert the last value of the array Code:

View Replies !
Inserting HTML Into A Database?
I'm trying to upload HTML into my database. I'm using:

$description=addslashes($_POST['description']);

However, when i use HTML inside the content that i'm uploading, the code gets all messed up, when viewing the code inside the textarea? I'm trying to build an EDIT section, But the code i want to edit is not user friendly? Code:

View Replies !
Inserting Some Data Into Database..
The code I have at the moment creates directories (mkdir) and copys files into them. This seems to work, but I need the variables "$mypath" and "$newfile5" to be inserted into my database. But it won't. It enters the other data such as name and description and creates the folder. Code:

View Replies !
Inserting An Array Into Database
If I have the following problem.

$adults=$_POST['adults'];//lets say its 2
$children=$_POST['children'];//lets say its 3
$rooms =array('101','102');

foreach($rooms as $roomnumber){
$insertSQL = "INSERT INTO bookings (roomNumber, adults, children) VALUES ( '$roomnumber', '$adults', '$children')";
$Result1 = mysql_query($insertSQL) or die(mysql_error());
}
This works BUT..each room gets (say) 2 adults and 3 children whereas I want the numbers spread over each room so that room 101 gets maybe 2 people and room 102 gets 3 people or vice versa and not double -up on the number of overall people. In a real life situation the user would choose the number of rooms and adults etc so the solution would need to allow for this. Can anyone see a way of doing this?

View Replies !
Inserting An Array Into A Database
I'm trying to insert an array into a database along with other information and finding it very difficult.  I want to insert a row into the database for each container that I get from "insert page 1". I get the amount of containers needed

(insert page 1)
<input type="text" name="number_of_containers" size="2">

I use a for loop to make the necessary amount of form fields for two variables and then have two static ones. What I want to do is enter in one row per container. Code:

View Replies !
Inserting A Session In Database
I have a page where users can send a message into the database which eventually the business can log in and  he/she can see, his/her messages. that had been posted to his business,

i am doing it with a session which,  i will call later to display the messages sent to that business my problem is that the $_SESSION['BusinessName']; is not bein taken to page2. I did some testing and it takes other values to page2 but not BusinessName value Code:

View Replies !
Inserting Into Database - GET The Email From The Url
i have a form for newsletter sign up, the customer enters their email in a text field and hits submit, once submit is clicked it process the form in "newsletter.php" I need to  GET the email from the url and then insert it into table newsletter, row "email" heres my messed up code so far.. i don't even know if i'm even close...

<?php

if($_GET['email']!="")
{

$newsletter = 'INSERT INTO newsletter (email) VALUES (".$_GET['email'].")';

}
?>

View Replies !
Inserting Info Into Database
I am trying to realize a function that after a user logged in, he/she can send comments. Hence, I am trying to get the session()'s user_id information, and insert it into the database. But somehow, the user_id could not be retrieved. Code:

View Replies !
Inserting News To Database.
I got this code to insert news to a database. I would like to create an html code using the values in the textarea and then post it into the database. heres my code:

View Replies !
Arrays And Inserting In To The Database
I have a form that uses two arrays one get's a list of courses from the database and one creates dates... i have two questions

1. how do i get the $i and $d value off of the arrays to insert in to the database, but still have each know they belong in the same row?

2. how do i change the dates from a multiselect dates ie, Jun 3, Jun 6, and Jun 12 to 'Jun 3, 6, 12'

here is the snippet of code from my select page. $numposts is a value selected on an earlier page. Code:

View Replies !
Inserting .sql File Into Database
I need PHP to allow me to upload tables.sql to my Database. Here is the code I have so far: Code:

View Replies !
Inserting Image In The Database
I know its not the best way to store mime data in the mysql but the database is designed so i have to go that way. I didnt have the idea to store and retrieve the mime data in the mysql.

View Replies !
Inserting Data Into Database
welll i currently work on a PERL-regEX that filters out the following data out of the dump of a ph ipBB that runs ths standard theme. After the regex i want to put the data into a database. Code:

View Replies !
Inserting Values Into DataBase
I have the problem with inserting several values in one field, from checkboxes (in the field appears only the value of last ticked checkbox). Code:

View Replies !
Date Is Not Being Pulled From MYSQL Database, Instead Current Date Is Displayed!
I am having trouble pulling a date from a database using PHP at the <a
href="http://www.mytuneslive.com/ameshkin69/"> following page.</a>

Here is the code. As you can see, it is just making the date the
current time. The values in the database are UNIX timestamp, and the
DATE() function is used to convert from UNIX to readable date. Can

<td width="55%" align="left" valign="top"><?php
$row_comment['timestamp'] = date("n d Y g:i A");.....

View Replies !
Script Not Inserting To Database Table
I submit the form to insert the data into the table, when I submit the form for this script to process, The "if" statement is true because the "echo" statement in the else says so, but the else is what the script is doing. Can't figure out why. PHP Code:

View Replies !
Inserting Values Into Database Using Arrays
I'm trying to insert the database the answers to a question and to get the user to select the correct answer. PHP Code:

View Replies !
Inserting An Array Of Photos Into Database
I have a form layed out like so to upload photos and input the file name into the database. Code:

View Replies !
Page For Inserting Information Into A Database
i'm making a page for inserting information into a database...i have the page all set up, and it works, but what i want is a little timer bar, kind of like when you are installing a program on the computer.  i was wondering if there is a way to do that...

it should be pretty fast, but not so fast as to just be pointless, 3 seconds or so i think.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved