Re: [PHP-DB] Reducing Strings to a certain length

2004-07-18 Thread Clod
Cole, Additionally, visit... http://ph.php.net/manual/en/function.substr.php clod On Jul 18, 2004, at 9:48 PM, Cole Ashcraft wrote: > How would you reduce a string to a specified length? Say reduce 600 to > 60 or abc to ab? Is there a PHP function for this? Will I have to > write my own co

Re: [PHP-DB] Reducing Strings to a certain length

2004-07-18 Thread Jim Root
http://us4.php.net/manual/en/function.substr.php On Sun, 18 Jul 2004 18:48:10 -0700, Cole Ashcraft <[EMAIL PROTECTED]> wrote: > How would you reduce a string to a specified length? Say reduce 600 to > 60 or abc to ab? Is there a PHP function for this? Will I have to write > my own code? > > Cole

Re: [PHP-DB] Reducing Strings to a certain length

2004-07-18 Thread Jonathan Hadddad
substr On Jul 18, 2004, at 9:48 PM, Cole Ashcraft wrote: How would you reduce a string to a specified length? Say reduce 600 to 60 or abc to ab? Is there a PHP function for this? Will I have to write my own code? Cole -- This message has been scanned for viruses and dangerous content by MailScanner

[PHP-DB] Reducing Strings to a certain length

2004-07-18 Thread Cole Ashcraft
How would you reduce a string to a specified length? Say reduce 600 to 60 or abc to ab? Is there a PHP function for this? Will I have to write my own code? Cole -- This message has been scanned for viruses and dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed to be cl

Re: [PHP-DB] oracle error ORA-12154

2004-07-18 Thread Christopher Jones
Adam Williams wrote: yeah I got it to work, i had to do putenv() with my oracle home dir and then my scripts started working. thanks It would be better to set the variables before starting the web server. See http://otn.oracle.com/tech/opensource/php/php_troubleshooting_faq.html#envvars Chris --

[PHP-DB] RE: [SPAM] Re: [PHP-DB] DB table creation question

2004-07-18 Thread Vincent Jordan
Does this seem to be correct? With this if value was inserted into a table will the tables with the FK's automatically be updated? Here is the DB design as I have it now. Let me know if all is correct please. CREATE TABLE customer_info ( cust_id int (6) UNSIGNED NOT NULL AUTO_INCREMENT PRIM

Re: [PHP-DB] Not Like

2004-07-18 Thread Cole Ashcraft
On Sun, 2004-07-18 at 15:00, John W. Holmes wrote: > Cole S. Ashcraft wrote: > > > I am trying to figure out how to display something where the condition > > is not like im a MySQL query. The query is > > > >> select * from class where classID like '_00'order by classID; > > > > > > How would

Re: [PHP-DB] Not Like

2004-07-18 Thread John W. Holmes
Cole S. Ashcraft wrote: I am trying to figure out how to display something where the condition is not like im a MySQL query. The query is select * from class where classID like '_00'order by classID; How would I make the like into a not like (aka negating it. The ! does not work)? I couldn't fi

[PHP-DB] Not Like

2004-07-18 Thread Cole S. Ashcraft
I am trying to figure out how to display something where the condition is not like im a MySQL query. The query is select * from class where classID like '_00'order by classID; How would I make the like into a not like (aka negating it. The ! does not work)? I couldn't find anything in the MySQL

Re: [PHP-DB] Re: Case sensitive search

2004-07-18 Thread John W. Holmes
Rui Cunha wrote: i suggest you to use the LIKE operator instead of the relational operator. You should try your suggestions before you.. er, suggest them: mysql> select 'a' like 'a'; +--+ | 'a' like 'a' | +--+ |1 | +--+ 1 row in set (0.00 sec) mysql>

Re: [PHP-DB] DB table creation question

2004-07-18 Thread Matthew McNicol
use the mysql 'auto increment' on a 'int' 'customer_id' field to generate a unique customer id. the RMA number is associated with a 'customer_id' since the 'customer_id' field is in both the customers table and the RMA table. Note that currently you have 'custid' and 'Customerid' respectively

Re: [PHP-DB] php, javascript and db - your help is needed

2004-07-18 Thread Justin Patrin
On Sun, 18 Jul 2004 13:24:01 -0700, Marcjon <[EMAIL PROTECTED]> wrote: > You could use a if/while construct. Something like: > > > if ($_POST['studentselect']){ > $result = mysql_query("SELECT courses FROM students WHERE student_name = > '" . $_POST['studentselect'] . "'"); > > while ($row = my

[PHP-DB] Re: Case sensitive search

2004-07-18 Thread Rui Cunha
Hi, i suggest you to use the LIKE operator instead of the relational operator. Rui Cunha Rosen writes: Hi, I have a simple table: test ( id int unsigned NOT NULL auto_increment, data varchar(30) default NULL, PRIMARY KEY (id)) with two simple records: id data 1 "a" 2

[PHP-DB] DB table creation question

2004-07-18 Thread Vincent Jordan
I am creating a database to keep track of our warranty returns. Currently we do not have anything to track warranty info besides a big excel file. I would like to keep customer data, product info and RMA data in separate tables but still keep them related. If I had table customers: custid Firstn

Re: [PHP-DB] php, javascript and db - your help is needed

2004-07-18 Thread Marcjon
You could use a if/while construct. Something like: ".$row['course'].""; } } ?> Basically you would submit the form, and if a student was selected, it would populate the list with their courses from the database. -- Marcjon - Original message - From: "G. Cohen" <[EMAIL PROTECTE

[PHP-DB] php, javascript and db - your help is needed

2004-07-18 Thread G. Cohen
Hello, I have a HTML form with 2 select boxes, lets say students and courses. When the from loads for the first time, I fill the students select box with data from database. The courses selectbox remains empty. When the user selects a value from the students selectbox (onchange event), I should go

[PHP-DB] RE: Rewrite value from form data

2004-07-18 Thread Jensen, Kimberlee
I have an even easier solution - why not just use three form fields, run a reg exp test on each individually for appropriate # of digits and then concatenate with "-" prior to insert? - - -

[PHP-DB] RE: Case sensitive search

2004-07-18 Thread Jensen, Kimberlee
Two options: 1. Use ALTER to make the field BINARY. 2. Use the BINARY modifier in your SELECT "select * from test where BINARY data='a' -Original Message- From: Rosen [mailto:[EMAIL PROTECTED] Sent: Sun 7/18/2004 2:45 AM To: [EMAIL PROTECTED] Cc: Subject:Case sen

[PHP-DB] Importing CSV to PostgreSQL

2004-07-18 Thread Robert Fitzpatrick
Can someone lend some guidance or point me to some docs on how to import an uploaded CSV file into a PostgreSQL table? I will need to evaluate the imcoming data line by line and set different columns to values depending on the evaluations. I would like to do this in a transaction so that if anythin

Re: [PHP-DB] Case sensitive search

2004-07-18 Thread Doug Thompson
Rosen wrote: Hi, I have a simple table: test ( id int unsigned NOT NULL auto_increment, data varchar(30) default NULL, PRIMARY KEY (id)) with two simple records: id data 1 "a" 2 "A" When I perform "select * from test where data='a' " - it return me both rows. http://dev.mysq

[PHP-DB] Case sensitive search

2004-07-18 Thread Rosen
Hi, I have a simple table: test ( id int unsigned NOT NULL auto_increment, data varchar(30) default NULL, PRIMARY KEY (id)) with two simple records: id data 1 "a" 2 "A" When I perform "select * from test where data='a' " - it return me both rows. By default in MySQL comp