[PHP-DB] PHP 4 inserting data in MySQL 3.23

2002-11-13 Thread Josh Jones
I'm running the following setup: Apache 2.0.40-8 MySQL 3.23.52-3 PHP 4.2.2-8.0.5 I have no problems retreiving data from the database and posting it to a website, but I can't insert data from the website to the database via forms or whatever. I'm new to this, but I've triple checked all the

RE: [PHP-DB] PHP 4 inserting data in MySQL 3.23

2002-11-13 Thread Snijders, Mark
try before the : if ($submit) this: phpself(); the vars are now declared on a different way in the new phph versions you need to do: if ($_POST[submit]){ and the insert values are also now : echo $_POST[phone]; so check phpinfo(); there are all the vars you need...

RE: [PHP-DB] small database

2002-11-13 Thread Edward Peloke
I agree with the others, don't try to store the picture in the db. What I did was provide a place for users to log-in to my site, when they signed up, I created a folder (using their username since that had to be unique). When they uploaded their pictures, I put the pictures in their folder and

[PHP-DB] airport codes db

2002-11-13 Thread Edward Peloke
I am working on a php page where I need some airport codes data, I have seen a few places online where you can buy this data so I was wondering if anyone has used any of these databases and if anyone had a good source for a mysql airport code db. Thanks, Eddie -- PHP Database Mailing List

[PHP-DB] Difference between 2 dates.. thoughts?

2002-11-13 Thread Aaron Wolski
Hi All, First off I have a query like this: SELECT dateinserted FROM SiteTrackingTable; Now. in this query any number of results could be returned 10 or 1000, etc. Is it possible to take the dateinserted value from the first record and then from the last record and perform some calculation

[PHP-DB] Oracle9i and PHP

2002-11-13 Thread George Pitcher
Hi, Can anyone point me in the direction of resources on PHP and Oracle9i (Win2K). I have the db installed on my laptop, on which I already have PHP running with IIS5 and would like to use PHP with Oracle. Any tips (even if it's a 'waste of effort' type) would be welcome. George in Oxford ===

[PHP-DB] Pull Word Docs

2002-11-13 Thread Steve Dodkins
Hi I'm trying to use the following echo a href=\.$myrow[parts_proc].\Procedure/a; where parts_proc contains the document path //ebmnw01/vol1/docs/proc1.doc In Internet Explorer it pulls the document correctly but in Mozilla it tries http:\\192.168.10.50\works\//ebmnw01/vol1/docs/proc1.doc is

RE: [PHP-DB] Difference between 2 dates.. thoughts?

2002-11-13 Thread Jason Vincent
You should be able to do this at the database level - of course you never said what database that is. Regardless, check your database documentation for the max() and min() functions - never used these on date but they might work - do you always want the first record and the last record in the

RE: [PHP-DB] Difference between 2 dates.. thoughts?

2002-11-13 Thread Aaron Wolski
Hi There, Well the first and last record of the results. So if 1000 records were found... then record #1 and then record #1000 - perform data calculation between those 2 records (how many days does this query span). Know what I am trying to say? Sorry if its not clear. Aaron -Original

RE: [PHP-DB] Difference between 2 dates.. thoughts?

2002-11-13 Thread Jason Vincent
Test whether min() and max() work on date fields - never tried it. Or check the documentation on date and time functions for your database - they may have something that does this. If not, you could just do an order by date ascending and grab only the first record, then an order by date

RE: [PHP-DB] Difference between 2 dates.. thoughts?

2002-11-13 Thread Aaron Wolski
Ok, Thanks for your input. I know very little about how to manipulate MySQL so this out to be fun and very slow going :-( Thanks! Aaron -Original Message- From: Jason Vincent [mailto:jayv;nortelnetworks.com] Sent: November 13, 2002 12:34 PM To: Aaron Wolski; [EMAIL PROTECTED]

Re: [PHP-DB] airport codes db

2002-11-13 Thread bbonkosk
You should take advantage of this highly international PHP communicty and set up a simple PHP interface to a table like: Airport Code | Airport City | Airport Name | Country | etc.. And then ask people to go in there and insert whatever information they know especially from around their area.

RE: [PHP-DB] airport codes db

2002-11-13 Thread alex hogan
You know that is an excellent idea. alex -Original Message- From: [EMAIL PROTECTED] [mailto:bbonkosk;tampabay.rr.com] Sent: Wednesday, November 13, 2002 6:38 AM To: Edward Peloke; [EMAIL PROTECTED] Subject: Re: [PHP-DB] airport codes db You should take advantage of this highly

Re: [PHP-DB] can i create an Access table or mdb with PHP?

2002-11-13 Thread John A DAVIS
I'm trying to supply our Contract Counties with mailing labels, already formatted. They log on to our website and PHP will hit our SQL Server and return a list of Public Water Systems for the County chosen. I would like a link on this page that says something like Send me an Access .mdb with

RE: [PHP-DB] Multiply Auto_Increments

2002-11-13 Thread Hutchins, Richard
Sounds like a looping problem in your code. Can you supply the code around your INSERT statement so we can see what's going on? The only times I've experienced anything Roswell about MySQL is when I've written bad code. Rich -Original Message- From: Toby Parkins

RE: [PHP-DB] Pull Word Docs

2002-11-13 Thread Peter Lovatt
Hi If the webserver is delivering the doc you need the path relative to the document, not the server file system. If the word doc is off the web root I think a href=get_doc.php?doc=proc1.docProcedure/a and get_doc.php is (assuming linux file system) ?php include

RE: [PHP-DB] Multiply Auto_Increments

2002-11-13 Thread Toby Parkins
Richard, Here is the code $sql = INSERT INTO $table (id,date,user,title,brief,body,expires,visible) VALUES(NULL,\$date\,\$user\,\$title\,\$brief\,\$body\,\$exdate\, \1\) ; $connection = mysql_connect($dbhost, $dbusername, $dbpass) or die (Could not

Re: [PHP-DB] can i create an Access table or mdb with PHP?

2002-11-13 Thread Anthony
You could use ODBC to do it. Create a template access DB, poulate it with ODBC, then read the file and send it to the user. After it's downloaded clear the table. the downside to this is that you would only be able to haev one user ata time get an access database. I'm sure there are better

RE: [PHP-DB] Multiply Auto_Increments

2002-11-13 Thread Hutchins, Richard
Looking at the code you've pasted in below, I don't see anything that would result in one valid row plus additional blank rows. Is the code you supplied in a script with any control structures like IF, WHILE, or FOR? Is it included into a script in the middle of a control structure? If you

[PHP-DB] any free php mySql Host's?

2002-11-13 Thread Paul Ihrig
Hey guys. i have a host at cfm-resources.com for coldfusion but now that i am getting into php. i would like to find a free host. any ones out there? thanks. -paul Whatever you can do, or dream you can, begin it. Boldness has genius, power, and magic in it. - Goethe web developer, that is

RE: [PHP-DB] airport codes db

2002-11-13 Thread Andy Crain
Or you could go here: http://flyaow.com/airportcode.htm Andy -Original Message- From: Edward Peloke [mailto:epeloke;echoman.com] Sent: Wednesday, November 13, 2002 1:32 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP-DB] airport codes db great idea...I am setting up a

[PHP-DB] mssql.datetimeconvert bug ?

2002-11-13 Thread Matt Brown
Hi All, We have MS Sql Server 7 running backend and are running our reports via PHP 4.2.3 (compiled with freetds), we have the flag mssql.datetimeconvert = 0 set in the php.ini, but yet all date/time(s) are returned as 'Nov 13 2002 02:26PM'... This is driving us mad, everywhere we search for a

[PHP-DB] date()

2002-11-13 Thread Edward Peloke
I have a date field in my mysql db, when I output the data to the screen, I don't want to see the minutes, just the mmddyy. I can format a date but can't seem to get it to work passing in the value from $myrow[datefield]any ideas? I don't want to have to worry about just pulling what I want

RE: [PHP-DB] date()

2002-11-13 Thread Aaron Wolski
$date = date(m:d:y, $myrow[datefield]); Will produce: 11:13:02 http://www.php.net/manual/en/function.date.php Aaron -Original Message- From: Edward Peloke [mailto:epeloke;echoman.com] Sent: November 13, 2002 4:27 PM To: Php-Db Subject: [PHP-DB] date() I have a date field in my

RE: [PHP-DB] date()

2002-11-13 Thread SELPH,JASON (HP-Richardson,ex1)
use the php function substr to chop off what you don't need, since all the dates can come from mysql as -mm-dd or however, just use substr($mydate, 0, 10) or however far out, that truncates the actual $mydate. -Original Message- From: [EMAIL PROTECTED] [mailto:epeloke;echoman.com]

Re: [PHP-DB] date()

2002-11-13 Thread Marco Tabini
If you don't want to change your SQL statement: echo date ('Y/m/d', strtotime ($myrow['datefield'])); Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparch.com!

Re: [PHP-DB] date()

2002-11-13 Thread Jason Wong
On Thursday 14 November 2002 05:27, Edward Peloke wrote: I have a date field in my mysql db, when I output the data to the screen, I don't want to see the minutes, just the mmddyy. DATE fields in MySQL don't have the time (h:m:s). I can format a date but can't seem to get it to work

Re: [PHP-DB] Multiple Inserts with mySQL

2002-11-13 Thread Peter Beckman
Try this: $stack is an array of hashes: $stack[0] = array(0=tablename, 1=insertid()); For each insert you do, push an anonymous array on $stack which includes the tablename and insertid of the insert. Then as you continue your inserts, if any of them fail, call a function which takes that

[PHP-DB] a menu item from a database, linked to a list from a another table

2002-11-13 Thread chip . wiegand
Is this even possible? I have a menu that is generated from a table. Typically, the menu items are links to html pages. I would like to have the link bring up a list of items from another table in the database, not an html page. So I guess this would be a select statement linked from a select

RE: [PHP-DB] Multiply Auto_Increments

2002-11-13 Thread Toby Parkins
Hi Richard, Thank you for all your time. It is nearly midnight here! All the code including // test sections is body background=#FF bgcolor=#FF p ? include(../include/config.php); /// // To be finished // if (checkdate($month, $day, $year)) {print (header etc. redirection if

[PHP-DB] Arrays again

2002-11-13 Thread Martin Allan Jensen
Hi everyone, I need a little help again I have a array with 4 values: 320 - 570 - 860 - 960 Each time it extracts one value it's supposed to take minus it with the old value. So that the output for the array above would be: 320 - 250 - 290 - 100 I hope you get the point and you're able

[PHP-DB] Arrays again again

2002-11-13 Thread Martin Allan Jensen
Sorry fellers Allready figured it outsorrynow i see that the question was foolish Anyway now i need help with something else... I now have some values: 320 - 250 - 290 - 100 And years that fits to them: 2002 - 2003 - 2004 - 2005 How can i put these dynamic values in a

[PHP-DB] Shopping Cart Sessions - Think this is a simple prolem - hopefully

2002-11-13 Thread Boa Constructor
Evening all, I'm pretty stumped with this basic shopping cart I'm trying to integrate into my site, if u wanna see what I'm on about visit http://www.hostmaster-x.co.uk/Products.php. On my products script I've got the following: ?php $shoppingcart = array(); session_start();

[PHP-DB] how to put all rows into an array

2002-11-13 Thread John A DAVIS
Is there anyway to take a resultset and cram it into an array? In VB it would be the GetRows function: myArray = rs.GetRows -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] how to put all rows into an array

2002-11-13 Thread Marco Tabini
while ($a[] = mysql_fetch_row ($rs)); should work Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparch.com! On Wed, 2002-11-13 at 19:27, John A DAVIS wrote: Is there anyway

[PHP-DB] Re: how to put all rows into an array

2002-11-13 Thread Adam Royle
No built-in function, but this can be handy (i have it inside a getData() function, which also lets me output data in a number of ways) HTH, Adam $sql = SELECT * FROM .; $DB_RESULT = mysql_query($sql); $arrData = array(); $rowCount = 0; while ($r =

Re: [PHP-DB] Arrays again again

2002-11-13 Thread Marco Tabini
Perhaps I don't understand what it is you're looking for, but... $a = array(); for ($i = 0; $i $maxvalue; $i++) { $a[$year] = $value; } but this is almost too simple, which probably just means I didn't quite understand your question. Marco -- php|architect - The magazine

Re: [PHP-DB] Arrays again again

2002-11-13 Thread Peter Beckman
The problem there is that you've got $a[$year] getting set a bunch of times. That is busted code. $a[$year] will only contain the LAST value. Replace that line with this one. $a[] = array(year=$year, value=$value); OR $a[$i] = array(year=$year, value=$value); Now $a[0][year] = 2002

[PHP-DB] upload data to MySql

2002-11-13 Thread Seabird
Hi everyone, I don't get my upload to work properly. It's a tutorial of the web, but it doesn't function (unless I made a mistake). Please help me... I have a form passing on 5 fields (text for testing), name: year, make, model, price, picture and submit to PHP_SELF ?php if ($submit) { $db =

Re: [PHP-DB] upload data to MySql

2002-11-13 Thread Boa Constructor
I'm new to file uploads, however I managed to get it working. Are you copying the file after its been uploaded? If not you need to do this as the temp file is destroyed after the script has finished running so you need to copy it if you wish to store it. You also will have to chmod 777 to the

Re: [PHP-DB] a menu item from a database, linked to a list from a another table

2002-11-13 Thread Jason Wong
On Thursday 14 November 2002 07:32, [EMAIL PROTECTED] wrote: Is this even possible? I have a menu that is generated from a table. What is your menu -- a set of a tags? or a selector box? I suspect you mean the latter ... Typically, the menu items are links to html pages. I would like to have

Re: [PHP-DB] upload data to MySql

2002-11-13 Thread Jason Wong
On Thursday 14 November 2002 04:47, Seabird wrote: Hi everyone, I don't get my upload to work properly. It's a tutorial of the web, but it doesn't function (unless I made a mistake). HOW doesn't it function? Please help me... You have to provide more information, like what you see when

[PHP-DB] A Question on Javascript

2002-11-13 Thread Shahmat Dahlan
I have a question on Javascript, if you don't mind. Say if I have a main page, whereby I would also have a html form which contains a button. Let's call it main document. When I click on the button it will open a new window, which refers to another html page. Now, let's call it child document.

RE: [PHP-DB] A Question on Javascript

2002-11-13 Thread Beau Lebens
Not that there is actually a question in there... I assume your question is How do I pass a value from a window which was opened via JavaScript, back to the window which opened it Short answer: window.opener -- read up in a javascript reference manual about this object. Longer answer after

[PHP-DB] Best reporting Tool

2002-11-13 Thread Mohammad Saad
Hi, I wanted to ask a question, Whats the best way of developing reports in PHP. I mean in case of ASP, developers use Crystal Reports but apparently PHP doesn't support Crystal Reports. so is there any other tool for me? or should I use conventional method of writing database queries, PHP paging