Re: [PHP-DB] Building WHERE SQL clauses

2008-09-16 Thread Goltsios Theodore
Hi all thanks for the responses! What I have is a 6 table db that has each table created from the output of 6 identical laboratory machines (chico, harpo, ...). The out put is a text file which I import as a table named after the machine. I do realize that one solution is to add the machine

Re: [PHP-DB] How to capture from session and match database

2007-09-19 Thread Goltsios Theodore
You can use cookies to keep your info so that you don't pass them from page to page. A way to do this is: $email = '[EMAIL PROTECTED]'; session_start(); setcookie('e-mail',$email); And then retrieve the cookie information using the $_COOKIE array: $query="SELECT * FROM table WHERE email = '".

Re: [PHP-DB] Form processing

2007-09-11 Thread Goltsios Theodore
I tried this: mail($to,$sub,$body); And it seems that it works just fine. If you really want help, you should post the code that is causing you trouble. Theodore ron.php wrote: I am trying to set up a form which will send e-mails for "late breaking news" and urgent e-mailings. If I hav

Re: [PHP-DB] pdo_mysql segfault error

2007-09-10 Thread Goltsios Theodore
Well this is not the proper list for these kind of questions but since you posted know that you should include the apache compile time options. Well I think that you should recompile apache, because mysql support is probably compiled in and since you upgraded mysql you should compile apache

Re: [PHP-DB] Dates - Best Approach

2007-09-10 Thread Goltsios Theodore
If you are using unix-like OSes then you could write a program or a script using (PHP, perl, bash, csh even C) whatever it suits you and use cron daemon to run it every month. This script should query the database and find out if is needed to be sent. The alternative (not the suggested so

Re: [PHP-DB] $db=new mysqli fails while $db=mysqli_connect succeeds in PHP/MySQL 5

2007-08-28 Thread Goltsios Theodore
Reposting the code sorry: host_info); /* close connection */ $mysqli->close(); ?> Linux NG/Lists wrote: Goltsios Theodore wrote: Well if you are in the unix case then you should check if your php supports mysqli :-) . In either case unix or not you could use phpinfo: Oh, so

Re: [PHP-DB] $db=new mysqli fails while $db=mysqli_connect succeeds in PHP/MySQL 5

2007-08-28 Thread Goltsios Theodore
ong.| Linux NG/Lists wrote: Goltsios Theodore wrote: Well if you are in the unix case then you should check if your php supports mysqli :-) . In either case unix or not you could use phpinfo: Oh, sorry, I thought I posted this before. Looks like I didn't. I'm pretty sure it suppo

Re: [PHP-DB] $db=new mysqli fails while $db=mysqli_connect succeeds in PHP/MySQL 5

2007-08-28 Thread Goltsios Theodore
Well if you are in the unix case then you should check if your php supports mysqli :-) . In either case unix or not you could use phpinfo: This will show a lot useful information about what your web server and your php can or cannot do. Linux NG/Lists wrote: The book I'm working with (PHP

Re: [PHP-DB] Re: [PHP] Passing variables to a PHP script on clicking a hyperlink

2007-08-24 Thread Goltsios Theodore
I thought I just did a comment and suggested that it is a lame solution to use $_REQUEST plus I did not know witch of the two method (POST or GET) would be appropriate so I picked up the lame way :-) . mike wrote: On 8/24/07, Goltsios Theodore <[EMAIL PROTECTED]> wrote: the pos

Re: [PHP-DB] Re: [PHP] Passing variables to a PHP script on clicking a hyperlink

2007-08-24 Thread Goltsios Theodore
I think that you can also do that buy making a drop down list with the available databases and pass the chosen database to another (or perhaps the same) script and make the queries and output results there. You can catch the posted or got option buy using the $_REQUEST array ($_GET and $_POST

Re: [PHP-DB] Connecting to more than 2 databases from a single PHP script.

2007-08-20 Thread Goltsios Theodore
You can still use PDO in order to access as many databases you need using different handlers. This is a way for e.g. $dbhost1 = 'localhost'; $dbuser1 = 'test'; $dbpass1 = '12345'; $db1 = 'database_name'; $dbh1 = new PDO('mysql:host='.$dbhost1.';dbname='.$db1, $dbuser1, $dbpass1); $dbhos

Re: [PHP-DB] __CYGWIN32__

2007-08-06 Thread Goltsios Theodore
Not sure if it is going to help but I think that the way the packaging is made differs between distros and OSes so why don't you check the way your distro divides sql into different packages. Perhaps the mysql standard package doesn't do the "magic" for you and you need more packages to add

Re: [PHP-DB] Connecting to mysql from another host

2007-08-03 Thread Goltsios Theodore
Well you it depends on what method you use to access mysql. If for instance if you use PDO you could do something like that to connect and query: $db_handler = new PDO('mysql:host='.$dbhost.';dbname='.$db, $dbuser, $dbpass); $query = "SELECT id, fname, lname FROM users WHERE id>'1'"; $st_h

Re: [PHP-DB] PHP Script to Run SQL file

2007-07-30 Thread Goltsios Theodore
In an another case that you have exported the database using mysqldump (using unix) then this could do the job: $cmd = '/usr/bin/mysql -h '.$dbhost.' -u '.$dbuser.' -p '.$dbpass.' < '.$file; exec($cmd,$out,$retval); } else { $cmd = '/usr/bin/mysql -h '.$dbhost.' -u '