[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
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 vari

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: AEC Submission Title: mailto:[EMAIL PROTECTED] Sent: Friday, 1 October 2004 11:24 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] The var

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: Where would I use the mysql_real_escape_string ? Thanks Justin -Original

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

2004-09-30 Thread Justin.Baiocchi
Hi, When I use the variable $_SERVER['AUTH_USER'] it comes out as domain\\username when inserted into the MySQL database. So when I try to update the record looking for a match as below it doesn't work because the query is looking for where ident=domain\username. $result = mysql_query("UPDATE aec

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 ""; Thanks for all the input -Original Message- From: Baiocchi, Justin (CSIRO IT, Armidale) Sent: Friday, 6 August 2004 12:50 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Php if statement in a fo

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 ""; }else{ print $row["timeout"]; } But now I get a parse error on the line -Original Message- From: Ng Hwee Hwee [mailto:[EMAIL PROTECTED] Sent: Friday, 6 August 2004 12:30 PM To:

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 t

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 "Current Staff Working Alone"; print ""; print "\n"; print "\n"; print "NameLocationTime inTime Out/tr>"; while ($row = mysql_fetch_array($result, MYSQL_B

[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

[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

RE: [PHP-DB] Update data problem

2004-06-23 Thread Justin.Baiocchi
Ok, I was trying to keep it simple :), but here goes: In essence the problem is that (at the end of the script) income_out is coming out as just $option_close_price and not the intended $option_close_price*$no_sold, and profit_loss is coming out as just -$option_close_price and not the intended $in

RE: [PHP-DB] Update data problem

2004-06-23 Thread Justin.Baiocchi
Sam, I have changed it but the result is still the same: Basically I am getting $E = $C , it seems that it is not picking up the value of $G (and there is a value of 500 in there and it is the only row of data). -Original Message- From: Sam Chill [mailto:[EMAIL PROTECTED] Sent: Thursd

[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

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

2004-06-22 Thread Justin.Baiocchi
Thanks Gary and those who replied, What I have ended up doing is using 3 tables: the original, a temporary one and the target table. It's clunky and probably not the way to do it, but this is my first php application and is just a learning exercise. -Original Message- From: Gary Every [

[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 t

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

[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 pag