[PHP-DB] 'Order by' question

2005-02-09 Thread Justin.Baiocchi
Hi, I have a MySQL varchar column which I wish to display. Most of the entries are numbers eg 1, 2, 3 etc etc. But some are numbers and letters eg 34A, 34B, 35A. When I display the column I am able to sort by number using the order by column_name+0 command, as in: $result = mysql_query(SELECT

RE: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem

2004-09-30 Thread Justin.Baiocchi
Thanks Ramil, I knew it had something to do with the \, but I still can't figure out how to get the variable into the database without the extra '\' It is entered into the database via a form using the input below: input name=ident type=hidden value=?php echo $_SERVER[AUTH_USER];? Where would I

RE: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem

2004-09-30 Thread Justin.Baiocchi
No, still no idea :) I did read the manual but I can't figure out how to use it in my script. I'll paste the page below: FORM ACTION=?php echo($PHP_SELF); ? METHOD=POST TARGET=_self table border=1 width=80% bgcolor=#0D9BA4 tr td width=29%bAEC Submission Title:/td td width=81%

RE: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem

2004-09-30 Thread Justin.Baiocchi
I made the change but the domain\username now appears in my database as: domainusername -Original Message- From: Ramil Sagum [mailto:[EMAIL PROTECTED] Sent: Friday, 1 October 2004 11:40 AM To: Baiocchi, Justin (CSIRO IT, Armidale) Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] The

[PHP-DB] Php if statement in a form

2004-08-05 Thread Justin.Baiocchi
Hello, I wonder if someone could point me in the right direction here. I have a table that is displayed that is also a form, and allowed a person to select a record to update using a radio button. With one of the fields of the form/table however, I would like it to display the value in the db (if

RE: [PHP-DB] Php if statement in a form

2004-08-05 Thread Justin.Baiocchi
Thanks Eric, I have changed it somewhat but am just getting a parse error, unexpected T_STRING on that line. My revised code is below: print bCurrent Staff Working Alone/b; print /td/tr; print /table\n; print table border=\1\ cellpadding=\3\ cellspacing=\0\\n; print

RE: [PHP-DB] Php if statement in a form

2004-08-05 Thread Justin.Baiocchi
Still no joy. The parse error actually refers to the -- if ($row[timeout] IS NULL); --- line. -Original Message- From: Eric Schwartz [mailto:[EMAIL PROTECTED] Sent: Friday, 6 August 2004 11:32 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Php if statement in a form Sorry. Forgot to

RE: [PHP-DB] Php if statement in a form

2004-08-05 Thread Justin.Baiocchi
Well, this works: so you were all on the right track if($row['timeout']==) { print input name='timeout' type='text' value='echo date('H:i')'; }else{ print $row[timeout]; } But now I get a parse error on the input line -Original Message- From: Ng Hwee Hwee

RE: [PHP-DB] Php if statement in a form (solved)

2004-08-05 Thread Justin.Baiocchi
Not to worry - manage to solve the problem using the line below $date=date('H:i'); echo input name=\timeout\ type=\text\ value=\$date\; Thanks for all the input -Original Message- From: Baiocchi, Justin (CSIRO IT, Armidale) Sent: Friday, 6 August 2004 12:50 PM To: [EMAIL PROTECTED]

[PHP-DB] RE: Subject: Update data problem

2004-06-24 Thread Justin.Baiocchi
Hi Neil, I have tried it like that with no luck, what is below just happens to be my latest attempts to get it working. What is happening is that it is saying that $C and $G are zero, when in fact there is data in there. How do I get it to 'refresh' the variables? That is what I am trying to do

[PHP-DB] Update data problem

2004-06-23 Thread Justin.Baiocchi
Hi there, I hoped someone might be able to tell me why this is not working. I have a form that updates the table 'media' with the 3 values below, that and some other variables are the only data in the table. That works nicely. I then want to update one of the other columns ($E) based on the

[PHP-DB] Retrieve data, add new fields and enter it in new table

2004-06-21 Thread Justin.Baiocchi
Hi, I am trying to do the following: - retrieve data from a table based on the $id field (easy enough) - add a few more fields to the data set, then - enter the data (and new fields) into a new table (based on the selected $id field) I'm just not sure how to structure this, do I use a temporary

[PHP-DB] Load data infile problem

2004-06-07 Thread Justin.Baiocchi
Hello, I have a page with a button that when clicked loads a pre-determined text file into my database. The code is posted below. However, when clicked the button does nothing, just opens up the same page again. The data does not get loaded into the database. any ideas? Thanks Justin The

RE: [PHP-DB] Load data infile problem

2004-06-07 Thread Justin.Baiocchi
Actually, I have just figured it out. It had to do with the 'slashes' around the query. The original $sql code was created using phpmyadmin, but I messed around with it until it worked, now using the following query: mysql_query(LOAD DATA INFILE 'C:abc.txt' INTO TABLE abc FIELDS TERMINATED BY