Search found 14 matches

by fredws
Thu Apr 29, 2004 11:10 am
Forum: mySQL & php coding
Topic: How to handle single quote in insert field
Replies: 1
Views: 691

How to handle single quote in insert field

I am getting an error, and I think that it is due to an apostrophe. Such as: INSERT into table1(memo) values ('{$myrow["memo"]}') which seems to give me fits if what is typed into the memo field is as: "Dad's phone number is bla bla bla" The apostrophe seems to mess up the query. How do you go about...
by fredws
Wed Mar 10, 2004 8:35 am
Forum: mySQL & php coding
Topic: Getting the last number from an auto_increment field
Replies: 2
Views: 855

Thats what I was after!

Thanks gesf!
by fredws
Mon Mar 08, 2004 9:15 am
Forum: mySQL & php coding
Topic: Getting the last number from an auto_increment field
Replies: 2
Views: 855

Getting the last number from an auto_increment field

What is the easiest way to go about finding what the last number was in an auto_increment field?

For instance, if I have a invoice table, where the invoice number is auto_increment, right after creating an invoice, how do I find what invoice number was assigned?
by fredws
Wed Sep 24, 2003 7:48 pm
Forum: mySQL & php coding
Topic: Checking value after Submit
Replies: 1
Views: 744

Checking value after Submit

I have a form on a page, that when submited, calls another php file that puts the information into the database. Is there any way to check the value of a field before it gets sent to the "insert.php" file? Or, do I just have to check it at the "insert.php" file, and if it is wrong redirect to the fo...
by fredws
Mon Sep 22, 2003 7:35 pm
Forum: mySQL & php coding
Topic: detecting blank field
Replies: 3
Views: 1037

That was what I was after!
Thanks liquedus!
by fredws
Mon Sep 22, 2003 6:12 pm
Forum: mySQL & php coding
Topic: detecting blank field
Replies: 3
Views: 1037

detecting blank field

What is the best way to check if a field is blank? For instance I want to print out addresses to the screen, but don't want a blank line if there is nothing on address line 2. This is what I have now: echo"$first_name $last_name<br>"; if ($address != '') echo"$address<br>"; if ($address2 != '') echo...
by fredws
Sun Aug 31, 2003 5:10 pm
Forum: HTML Basics
Topic: Combo box?
Replies: 3
Views: 2693

Combo box?

Is there such a thing as a combo box? What I want is for the user to be able to select from a list of items, or be able to type in a new one if what they want is not in the list. Is this possible?

Thanks!
by fredws
Sat Aug 23, 2003 6:02 pm
Forum: mySQL & php coding
Topic: NOW() in UPDATE query?
Replies: 3
Views: 1025

Thanks! I had forgotten and put the quotes in there!
by fredws
Sat Aug 23, 2003 3:07 pm
Forum: mySQL & php coding
Topic: NOW() in UPDATE query?
Replies: 3
Views: 1025

NOW() in UPDATE query?

Can you use NOW() in an update query? I am trying it, but not having much luck, it seems to be setting the value to "NOW()" instead of the actual date and time.

TIA,
Fred
by fredws
Sun Aug 17, 2003 7:18 pm
Forum: mySQL & php coding
Topic: How to let user change sort order?
Replies: 2
Views: 902

That's what I was after!
Thanks Joel!
by fredws
Sun Aug 17, 2003 3:52 pm
Forum: mySQL & php coding
Topic: How to let user change sort order?
Replies: 2
Views: 902

How to let user change sort order?

Right now I have a page that pulls data from a table, like so: // get client list $query = "SELECT * from clients ORDER BY company"; $result = mysql_db_query($database, $query, $connection) or die ("Error in query: $query. " . mysql_error()); //interate through resultset and display while (list($cli...
by fredws
Thu Jul 17, 2003 9:52 am
Forum: mySQL & php coding
Topic: Grouping query results and putting in a table
Replies: 3
Views: 1075

Well, I got it!
I left my query the same, with the ORDER BY company in there, then
I just had to put in some if statements and some checks to see if the company name was different, and if so, put in the html tags to put a border up.
by fredws
Wed Jul 16, 2003 6:03 pm
Forum: mySQL & php coding
Topic: Grouping query results and putting in a table
Replies: 3
Views: 1075

I tried that, but then it gave only the first instance. I was wrong in my first post, the tables are called "clients" and "orders" here is the code that I have now: $connection = mysql_connect($hostname, $user, $pass) or die ("Unable to connect!"); // get project list $query = "SELECT clients.compan...
by fredws
Wed Jul 16, 2003 5:14 pm
Forum: mySQL & php coding
Topic: Grouping query results and putting in a table
Replies: 3
Views: 1075

Grouping query results and putting in a table

I hope I am in the right forum to ask this. I have a database with a company table and a clients table. There are several clients for each company. What I am wanting to do is group these, such as putting them in a table or box where I would have : Company1 client1 info client2 info client3 info Comp...