[PHP-DB] ODBC to MSSQL on FreeBSD for PHP

2003-10-09 Thread rick rice
What do I need and where can I get it? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] array manipulation with foreach

2003-03-26 Thread David Rice
I am trying to make a bit of code that takes values from 2 arrays, one array has a list of all the date's of this week starting from sunday, $arraydate[$n] = "the date" where $n is an integer between 0+6 the other is a multidimensional array composition as such; $rota[$staffid][$x] = "date sta

[PHP-DB] date to Y-M-D

2003-03-25 Thread David Rice
a function to convert any date to ymd... function datetoymd($date){ $dateymd = date('Y-m-d',$date); return $dateymd; } this function when output gives me the date 1970-01-01 (date of the unix timestamp start) so, ehm, why!? cheers, dave ___

[PHP-DB] creating a date array

2003-03-25 Thread David Rice
trying to make an array with every date (in -MM-DD format) of the current week in it... the below code ain't working, any ideas?! cheers, dave function createdatearray($sunday){ $date = date('Ymd',strtotime($date)); for($x=0; $x<=7; $x++){ $y = $x + 1;

[PHP-DB] finding out the date of the first day of the current week

2003-03-23 Thread David Rice
I am trying to make a small function that will me the date in Y-m-d of the start of the current week (the sunday) I have only the idea of doing it by making a long drawn out script with if, elseif clauses for every day of the week... and then doing something like if ( date('D') = "mon" ) { $

[PHP-DB] adding to an array variable using a loop...?

2003-03-10 Thread David Rice
I want to create an array from results returned from a mysql query. I want it to go through each row in the returned result, and if the variable in the array staff exists add 1 to the total, if it doesnt exist, set it as one and carry on. But when i run this and do var_dump, it just returns "1"

Fwd: Re: [PHP-DB] need help with foreach()

2003-03-10 Thread David Rice
Here is the complete function I am using. I returned, for testing i commented out the foreach loop and returned $staff, then $tips both arrays returned NULL when i did a var_dump(pointvalue($startdate)); can anyone see how this could be solved? Cheers, dave =

Re: [PHP-DB] need help with foreach()

2003-03-09 Thread David Rice
Hey thank's for the ideas but neither of them work, doh... Okay fredrik I know your idea won't work cos list only works with numericaly indexed arrays, both the arrays that i am using are indexed by date. (it produces a parse error when run) = while(list($d, $t) = each($tips)

[PHP-DB] need help with foreach()

2003-03-09 Thread David Rice
Okay, i have two arrays, $tips and $staff $tips has a key "date" (which is the date of the first day of the week, the second result in the array has the key of the second day of the week etc... ) and the value is a floating point decimal. $staff also has a key "date" and the value is an integer

[PHP-DB] Multidimensional arrays / Dynamic variables

2003-03-09 Thread David Rice
Okay the problem is adding another result to the multi-dimensional array When i perform var_dump on the returned varialbe $tips i get array(1) { [2]=> array(1) { [0]=> string(10) "2003-03-07" } } I know that there are 2 results missing here for when the key of the array is 1 ($sta

[PHP-DB] Dynamic Variable names

2003-03-09 Thread David Rice
Just a quick question about dynamic variables would like to end up with a variable called $tips_1 $tips_2 ... $tips_n where "n" is the value of the variable $sid i have tried $tips . '$sid'; and other variants, but i can't get one that doesn't return a parse error or T_VARIABLE error. ___

Re: [PHP-DB] Re: subtracting times (solution)

2003-03-08 Thread David Rice
It took me about 30 mins but after 2 attempts i came up with a function that subtracts 2 times to give an answer in hours, to two decimal places. thanks for your help the two people who responded when i posted the question, your suggestions were a bit out on a tangent from what i wanted. But th

[PHP-DB] subtracting times

2003-03-08 Thread David Rice
I know I asked this before buy no-one gave me an answer i was looking for, I want to subtract two times and the ammount of hours worked to 2decimal places (3.41 hours) cheers, dave _ Use MSN Messenger to send music and pics to you

[PHP-DB] Subtraction of two units of time.

2003-03-06 Thread David Rice
I want to take away two times stored in the format "00:00:00" in a mysql database, i retrieve the times and take them away by using the following $total = $time1 - $time2 ; when i echo the total it is a whole number of the hours.. and does not take the minutes into account, anyone have an ide

Re: [PHP-DB] date functions (generates parse error)

2003-03-05 Thread David Rice
Sorry, I forgot to add the part at the bottom where I am calling the function = $start = date('Ymd',strtotime($weekstart));   $query = "SELECT * FROM Rota WHERE date >= $start and date <= ($start + INTERVAL 6 DAY) ORDER BY staff

Re: [PHP-DB] date functions (generates parse error)

2003-03-04 Thread David Rice
Here is the whole code of my function Whenever i run it, it say's there is a parse error on line 6, can't see what is the problem the format of $weekstart (as it is stored in the Database) is -MM-DD = $start = date('Ymd',strto

[PHP-DB] date functions

2003-03-04 Thread David Rice
I want to use it in this function that i am creating (it's for a resteraunt automated tips system, to work out how much tips each staff member is entitled to. function tips($weekstart){ /* JUST BELOW HERE IS WHE

[PHP-DB] date functions

2003-03-04 Thread David Rice
I am looking for a way to take a date stored in a mysql database... and find out the date seven days later. how would i do this?! cheers, dave _ Chat online in real time with MSN Messenger http://messenger.msn.co.uk -- PHP Data

Re: [PHP-DB] need help with fetching a result using a function

2003-03-02 Thread David Rice
mation. I have tested it with other queries that work... and there is no problem, i am definately connected to the database From: Koleszár Tibor <[EMAIL PROTECTED]> To: "David Rice" <[EMAIL PROTECTED]> Subject: Re: [PHP-DB] need help with fetching a result using a function

[PHP-DB] need help with fetching a result using a function

2003-03-02 Thread David Rice
I am trying to write a few functions for a project i need to do for school, this function should return all the inactive, or active users (1 or 0 staffstatusid) as an array for creating a drop down menu. Now when i perform the following code (yes it is included in a script that connects to the

[PHP-DB] Session troubles, could this be my isp's fault?

2003-02-25 Thread David Rice
I Have made two pages, "sess2.php" and "sess3.php" trying to create a session variable then access it in the other page. now when i try and call the session in the second page i get no value, and i have tried var_dump, and it gives me "NULL" anyone know if there is a reason for this?! page 1

[PHP-DB] SESSIONS

2003-02-25 Thread David Rice
Here's something i can't get working it won't go to the last clause of this page i don't think it can set the session variable anyone see what im doing wrong? i need more caffeine to get my brain fired up today lol.. ===

[PHP-DB] PHP session problems

2003-02-25 Thread David Rice
I have been having trouble with PHP sessions, the session variables are not able to be called through the script. If have commented the area at the bottome where the session variable is NULL when var dump is called to check it (about 20 lines from the bottom... depending on if the text is wrapp

RE: [PHP-DB] need help spotting this php parse error

2003-01-23 Thread David Rice
It Does have a closing Brace, just check my second email it contains the FULL code.. i missed the last few lines copying it the first time somehow. From: "Andreas Sheriff" <[EMAIL PROTECTED]> To: "David Rice" <[EMAIL PROTECTED]> Subject: RE: [PHP-DB] need he

[PHP-DB] Re. Need help spotting PHP parse error

2003-01-23 Thread David Rice
"Parse error: parse error in /home/filterseveuk/public_html/project/login.php on line 34" That is the exact error message, Cheers, Dave session_start(); if(!$HTTP_COOKIE_VARS["username"]) { /* The Cookie is not set, so load the page as if it is the first time */ require("library/in

[PHP-DB] need help spotting this php parse error

2003-01-23 Thread David Rice
When i run this script it tells me that I have a parse error on line 34? I really can't see it anyhelp (please!) would be much appreciated Cheers, Dave session_start(); if(!$HTTP_COOKIE_VARS["username"]) { /* The Cookie is not set, so load the page as if it is the first time */ inclu

Re: [PHP-DB] build menu with mysql data

2003-01-21 Thread David Rice
Rite marc, this is what your gonna have to do, in a new table like this lets say we call it "MAINSUB" MAINMENU ID SUBMENU ID it only contains those 2 fields to show that there is a link between the two okay? now to the actual menu < for($x=2, $x < 4, $x++ < SELECT * FROM MAINSUB WHERE MAINME

[PHP-DB] MySql DB, help, sql error and i don't know why

2003-01-21 Thread David Rice
SQL-query : CREATE TABLE `staff` ( `StaffId` INT( 4 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `Name` VARCHAR( 30 ) NOT NULL , `Surname` VARCHAR( 30 ) NOT NULL , `Address` TEXT( 225 ) NOT NULL , `JobId` SMALLINT( 2 ) NOT NULL , `PermissionId` SMALLINT( 2 ) NOT NULL , `HomePhone` INT( 11 ) NOT NULL

[PHP-DB] php -> excel

2003-01-19 Thread David Rice
Just a question, is it possible to dynamically create an excel spreadsheet from data in a mysql database the excel sheet does not have to be displayed, just to be sent to print, to give better print quality than a webpage tables equivalent. Or is there another way of doing this? __

[PHP-DB] MySql Update.

2002-11-12 Thread David Rice
Making an update query that adapts to the number of fields that are to be updated Is there anyway to do like a for loop to create the values part of the query then combine it with the first part of the string. something like what i have below... although something that works correctly as thi

[PHP-DB] Dynamic MySql Update Query

2002-11-12 Thread David Rice
co.uk/admin/index.php and if you check a table, and choose an edit query on one of the records to see what i am trying to do. thank's for your time! cheers, David Rice _ The new MSN 8: smart spam protection and 2 months

[PHP-DB] retrieving data from mysql table

2002-11-10 Thread David Rice
okay thank's for the help on my previous question. I've got it to retrieve a list of column headers now, i want it to retrieve all the records from the table and print them underneath. the code i have is ** /* get a list of

[PHP-DB] Extracting column names from a db

2002-11-10 Thread David Rice
I need to write a script that will extract the names of the columns in my database eg. "user_id, username" can anyone help as to how to do this! I have tried ** *** mysql_select_db("filterseveuk") or die(mysql_error()); $query = "SHOW CO

[PHP-DB] need help with SHOW COLUMNS

2002-11-05 Thread David Rice
I am tryin to create a DBMS, the part of my code that is currently causing a problem is mysql_select_db("filterseveuk") or die(mysql_error()); $query = "SHOW COLUMNS FROM " .$table. ""; $result = mysql_query ( $query ) or die( mysql_error () ); $numrows = mysql_num_rows ($result); $r

[PHP-DB] need help with "SHOW Colums"

2002-10-31 Thread David Rice
the table name "user" with a variable $table, that wil automatically take the value of the selected table. I have tried many times but cannot get the correct sql syntax, it keeps saying "you have an error in your sql syntax near 'user' line 1" when i try it with $table.

Re: [PHP-DB] Database question

2002-09-04 Thread Raquel Rice
On Tue, 20 Aug 2002 18:34:48 -0500 "Shiloh Madsen" <[EMAIL PROTECTED]> wrote: > I was wondering if there were any good documents out there about > good database design...I know the basics of creating tables, > setting data types and such, and now i want to know how to use it > to the best effect.

Re: [PHP-DB] best way to stare true, false

2002-08-10 Thread Raquel Rice
On Sat, 10 Aug 2002 17:41:56 +0200 "andy" <[EMAIL PROTECTED]> wrote: > > > Hi there, > > > > > > I am searching for the best way to store true or false inside > > > a MySQL DB. With best I mean the most data efficient way and > > > in the same time the best for fast searching later on the > > > t

Re: [PHP-DB] best way to stare true, false

2002-08-10 Thread Raquel Rice
On Sat, 10 Aug 2002 16:46:54 +0200 "andy" <[EMAIL PROTECTED]> wrote: > Hi there, > > I am searching for the best way to store true or false inside a > MySQL DB. With best I mean the most data efficient way and in the > same time the best for fast searching later on the table to find > all which

Re: [PHP-DB] Auto Increment Problems....

2002-07-29 Thread Raquel Rice
On Mon, 29 Jul 2002 20:44:54 -0700 Georgie Casey "Georgie Casey" <[EMAIL PROTECTED]> wrote: > rite, > > my primary key column ("id") is set to auto_increment as usual > which is very > handy. But when I delete a row, the auto_increment just keeps > incrementing > and there's this 'hole' left whe

Re: [PHP-DB] Re: Storing Variable & Function Info

2002-07-24 Thread Raquel Rice
On Wed, 24 Jul 2002 16:49:38 -0400 Martin Clifford "Martin Clifford" <[EMAIL PROTECTED]> wrote: > You're trying to use double quotes, in which the variable is > evaluated and the stored value is shown, right? Try using single > quotes. For example, with $name = "Martin". > > echo "My name is $

Re: [PHP-DB] Re: Storing Variable & Function Info

2002-07-24 Thread Raquel Rice
On Wed, 24 Jul 2002 13:23:54 +1200 David Robley David Robley <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] says... > > I've run out of ideas. I want to store a variable name and a > > function call in a text column of a MySQL database and have them > > interpr

[PHP-DB] Storing Variable & Function Info

2002-07-23 Thread Raquel Rice
I've run out of ideas. I want to store a variable name and a function call in a text column of a MySQL database and have them interpreted at runtime, but I can't figure out how to do it. Examples: "This is the $nbrtimes you've asked." and "$answer is the square root of sqrt($nbr)." I've tried

Re: [PHP-DB] remove from db renumbering

2002-06-30 Thread Raquel Rice
On Sun, 30 Jun 2002 20:21:18 -0400 Chris Payne "Chris Payne" <[EMAIL PROTECTED]> wrote: > Hi there everyone, > > I have my id field auto incrementing (Of course) and I have a > utility > that allows me to remove items from it, the problem is when I > remove > something the items after it keep t

Re: [PHP-DB] Converting upper case letters to lower case because of db??

2002-02-07 Thread Raquel Rice
On Thu, 7 Feb 2002 17:07:35 +0100 Andy "Andy" <[EMAIL PROTECTED]> wrote: > Hi there, > > I have a tabel with 250 entries showing a country code lik "CA" > > Now my application does not work on linux, because they have to be > in lower > case. > > Can I make anyhow an bufix, or even better crea

Re: [PHP-DB] uploading

2002-01-27 Thread Raquel Rice
On Sun, 27 Jan 2002 13:04:09 +0200 Thomas \ "Thomas \"omega\" Henning" <[EMAIL PROTECTED]> wrote: > Hello how can i upload something from my hdd to the webserver > using php? > > note: don't have ftp on the machine!! > > Thanks > > Thomas "omega" Henning I usually don't like saying this, but

Re: [PHP-DB] How do I know when to

2002-01-11 Thread Raquel Rice
On Fri, 11 Jan 2002 17:21:28 -0800 Jerry Leonard "Jerry Leonard" <[EMAIL PROTECTED]> wrote: > Okay this is the way I understand the statement below. The uid > will be a > number from 1 to 10, max length of ten digits say starting at 1 > then as the > next user registers it will automatically make

Re: [PHP-DB] How do I know when to

2002-01-11 Thread Raquel Rice
On Fri, 11 Jan 2002 15:02:00 -0800 Jerry Leonard "Jerry Leonard" <[EMAIL PROTECTED]> wrote: > Hi, > > I am really new to MySQL and am wondering this: > > I understand how to make a database and tables but what I don't > understand > is when to make a row an "int" with auto_increment or just a p

Re: [PHP-DB] hiding blank MySQL results?

2002-01-05 Thread Raquel Rice
On Sat, 5 Jan 2002 01:12:21 - Nathon Jones "Nathon Jones" <[EMAIL PROTECTED]> wrote: > Hi. > > I have a PHP page calling a set of results from a MySQL database. > They > appear in the following format on the results page: > > Title > Description > Link > > Problem I'm having. When a db r

Re: [PHP-DB] EZ Question...I think

2001-12-03 Thread Raquel Rice
On Mon, 3 Dec 2001 17:31:30 -0500 Thomas "Thomas" <[EMAIL PROTECTED]> wrote: > I have looked into some source code that I found, but I'm a newbie > at this, > and don't understand.. > > if ( 0 == $this->link_id) { > > In this statment, what does the '->' repersent? this statment > (operator?)

Re: [PHP-DB] php3-php4 mysql problem with nl2br coding

2001-11-24 Thread Raquel Rice
On Fri, 23 Nov 2001 14:04:00 -0600 Terry Romine Terry Romine <[EMAIL PROTECTED]> wrote: > I seem to have run into a strange bug where when I enter text > through a > form, and use the nl2br call in PHP, instead of getting "" I > get > "" and then my parsing fails on the display side (where I >

Re: [PHP-DB] "Lost Access Logging Out" why do you taunt me IE?

2001-11-12 Thread Raquel Rice
On Tue, 13 Nov 2001 04:30:06 +0800 Brian Tegtmeier "Brian Tegtmeier" <[EMAIL PROTECTED]> wrote: > Sup all. I'm currently running into a problem (can send source if > needed) with this news script called "PHP-News" at > http://www.hotscripts.com/Detailed/7145.html where if I login to > the admin a

Re: [PHP-DB] MySQL Query

2001-10-26 Thread Raquel Rice
On Sat, 27 Oct 2001 13:36:57 +1000 "Andrew Duck" <[EMAIL PROTECTED]> wrote: > Error > SQL-query : > > CREATE TABLE mail ( > from int(32) NOT NULL default '0', > to int(32) NOT NULL default '0', > subject varchar(80) NOT NULL default '', > message text NOT NULL > ) TYPE=MyISAM > > >

Re: [PHP-DB] connecting to msql... easy question!

2001-10-20 Thread Raquel Rice
On Sat, 20 Oct 2001 09:16:26 -0400 David Bedingfield <[EMAIL PROTECTED]> wrote: > ...still no luck with this... any help? > > David Bedingfield wrote: > > > With a basic php document, I am trying to create a table. I have a good > > code for the table (I think) but I cannot connect to the SQL s

Re: [PHP-DB] Sessions and Frames

2001-10-18 Thread Raquel Rice
> > -Original Message- > > From: TJayBelt <[EMAIL PROTECTED]> > > To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > Date: Thursday, October 18, 2001 8:28 AM > > Subject: [PHP-DB] Sessions and Frames > > > > > > >I have a site that is successfully using sessions and authentication. > > >However

Re: Re[2]: [PHP-DB] padding an id field

2001-10-04 Thread Raquel Rice
On Thu, 4 Oct 2001 14:17:22 -0300 WebDev <[EMAIL PROTECTED]> wrote: > Thursday, October 04, 2001, 1:13:59 PM, you wrote: > > RR> When you define your auto-incrementing column, can't you specify > RR> "ZEROFILL"? I believe it pads to the left with zeroes. > > Hello Raquel, > > Yes, but is it p

Re: [PHP-DB] Cybercash? or Who?

2001-10-03 Thread Raquel Rice
On Wed, 3 Oct 2001 09:49:20 -0600 Ricky Theil <[EMAIL PROTECTED]> wrote: > I just recently started using Cardservice International for all my > precessing. The only drawback was that I had to purchase an API wrapper, > but it is a PHP wrapper. It was $95. It's extremely fast, and easy to use.

Re: [PHP-DB] Re: MySQL Database Locking - needed?

2001-07-10 Thread Raquel Rice
Tom Peck wrote: > > > >How about writing a text file that would be your "lock" file, rather > >than depending upon MySQL to do it for you? > > > >-- > >Raquel > > So what you mean is: > > If someone clicks on a car to edit, a txt file is written (maybe called the > carID.txt). Then if someone e

Re: [PHP-DB] Re: MySQL Database Locking - needed?

2001-07-10 Thread Raquel Rice
Tom Peck wrote: > > Thanks for the reply Manual. > > The updating IS done with one single query - but the problem is that if two > people are editing the same car, the second update will overwrite the > first. Not a huge problem - and the chance of it happening is almost nil - > but there is st

Re: [PHP-DB] connecting to database..?

2001-05-21 Thread rice
nching, it might be encountering an error and > quietly dieing as soon as you launch it. I'm successfully running Apache > 1.3.19, PHP 4.0.5, and MySQL 3.23.38. When I upgraded from MySQL 3.23.32 I > had that same warning come up, all it took was restarting mysqld and the > warning

Re: [PHP-DB] connecting to database..?

2001-05-20 Thread rice
I have the same problem as you when using apache1.3.19, php4.0.5 and mysql3.23.38 and get the same warning message. I've spent many time to compile the system again but failed. So I forgive to use the newest version and use apache1.3.17, php4.0.4 and mysql3.23.38. It works now! Hope someone can h