[PHP-DB] Re: best solution with db..?
Hi Andrius! It is depending on the style of the table. There are some solutions. One way is to split the the table in definition and content. This is the most open solution. For example: Table: Definition IDNameContentID Table: Content IDLanguageContentValue ForeingKey: Definition.ContentID - Content.ID Example Query: SELECT Content.Value AS value FROM Definition,Content WHERE Definition.ContentID=Content.ID AND Definition.Name='$Name' AND Content.Language='$Language' An easier way is to add a row language to the table. But this way is not so open for other dependencies of the content. The recreation of the table with different name is possible but is not so open too. bye Marcus Andrius Jakutis [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I am newbie, so, please give me advice. Ok, I have PHP webpage, where I give information from MYSQL database (Info in english). I'd like to have website in german. Should I recreate (double) tables (those, where is text which is needed to be translated), or there is some clever solution? I have no idea. Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] mssql update adds blank to record
can anyone help me ??? the command: mssql_query(UPDATE IP_Host SET Device_Name='$Device_Name', Device_Owner='$Device_Owner', Description='$Description' WHERE ID=$ID); creates always a blank character at the first position of the record. how can i get rid of that ??? thx stephan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Odp: [PHP-DB] mssql update adds blank to record
Try ltrim($Device_Name); before running query Bartek Pawlik - Original Message - From: Stephan Nimtz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 10:21 AM Subject: [PHP-DB] mssql update adds blank to record can anyone help me ??? the command: mssql_query("UPDATE IP_Host SET Device_Name='$Device_Name', Device_Owner='$Device_Owner', Description='$Description' WHERE ID=$ID"); creates always a blank character at the first position of the record. how can i get rid of that ??? thx stephan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- OnetKomunikator - porozumiesz sie z innymi [ http://ok.onet.pl/instaluj.html ] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mssql update adds blank to record
thanks, this helped Try ltrim($Device_Name); before running query Bartek Pawlik - Original Message - From: Stephan Nimtz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 10:21 AM Subject: [PHP-DB] mssql update adds blank to record can anyone help me ??? the command: mssql_query(UPDATE IP_Host SET Device_Name='$Device_Name', Device_Owner='$Device_Owner', Description='$Description' WHERE ID=$ID); creates always a blank character at the first position of the record. how can i get rid of that ??? thx stephan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- OnetKomunikator - porozumiesz sie z innymi [ http://ok.onet.pl/instaluj.html ] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] PHP linux interbase Apache
Hi all I'm new on PHP. I've installed PHP interbase Apache correctly. But I would like to connect Interbase database through PHP. So I enable interbase support for php by doing this : ./configure --with-interbase --with-apache --enabled-track-vars make make install Evreything works fine When I do this : ? $conn=ibase_connect(192.168.2.2:/opt/interbase/examples/employee.gdb, SYSDBA, masterkey); if (!$conn) { echo Access Denied!; exit; } ? my browser say :Call to undifined function :ibase_connect. I understood that I must enable the extension in php.ini. I think the extension was automatically added to my php.ini but I can not find any entry in php.ini for interbase. If someone could help TIA Steph -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Forms Question
Hi there, Take a look at the following snippet below. It is similar to what you're looking for without having to bugger about duplicating loads of lines for each store. Just add a new one to the array if required. Best Regards, - Paul - select name=MonthSelected size=1 ?php $MonthArr = array ( January, February, March, April, May, June, July, August, September, October, November, December, ); reset($MonthArr); foreach ($MonthArr as $MonthName) { echo option VALUE=\$MonthName\; if ($MonthName == $MonthSelected) echo selected; echo ; echo $MonthName; } ? /select - Original Message - From: Steve Cayford [EMAIL PROTECTED] To: Jeff Grossman [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, September 05, 2001 11:36 PM Subject: Re: [PHP-DB] Forms Question On Wednesday, September 5, 2001, at 04:50 PM, Jeff Grossman wrote: Hello, Here is the code I have: while ($row=mysql_fetch_array($result)) { $store=$row[store]; $jobdesc=$row[jobdesc]; echo FORM METHOD=post ACTION=update.php; echo PStore: Select NAME=\$store\ option VALUE=\Signal Hill\Signal Hill option VALUE=\Reseda\Reseda option VALUE=\Orange\Orange option VALUE=\West Covina\West Covina option VALUE=\Riverside\Riverside option VALUE=\Norwalk\Norwalk option VALUE=\Fountain Valley\Fountain Valley option VALUE=\Pasadena\Pasadena option VALUE=\Redondo Beach\Redondo Beach option VALUE=\San Bernardino\San Bernardino option VALUE=\Kearny Mesa\Kearny Mesa option VALUE=\San Marcos\San Marcos option VALUE=\Chino\Chino option VALUE=\Coporate Office\Corporate Office /select/P; echo PINPUT TYPE=text SIZE=35 NAME=\Jobdesc\ VALUE=\$jobdesc\/P; echo pINPUT TYPE=submit VALUE=\submit\ LABEL=\Save Changes\/P; } Is want I am trying to do possible? I want the value which is stored in $store to automatically fill in on the drop down list. But, for some reason it is defaulting to the first option, and not using the value that is in the database. Can I use a drop down menu, or should I just go to radio buttons? Thanks, Jeff If I understand your question... In order to have your value preset in the drop down list you need indicate that with option value=\blahblah\ selectedblahblah What I've been using for this is a hash like this: while ($row=mysql_fetch_array($result)) { $selected = array(); $selected[$row[store]] = selected; $store=$row[store]; $jobdesc=$row[jobdesc]; echo FORM METHOD=post ACTION=update.php; echo PStore:; echo Select NAME=NameOfVariableToBePosted echo option VALUE=\Signal Hill\ . $selected[Signal Hill] . Signal Hill; echo option VALUE=\Reseda\ . $selected[Reseda] . Reseda; ...etc, etc., etc. something along those lines, anyway. So, if $row[store] == Signal Hill, then $selected[Signal Hill] will be set to selected, while $selected[Reseda] and all the others will be blank. This is a very keen thing about php. -Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Newbie Help: Searching
have 2 vars $Tech and $Admin and then chnage you SQL so it says: $Query = SELECT * FROM enet WHERE TechContact LIKE '%$Tech%' AND AdminContact LIKE '%$Admin%'; Steve Devon [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $Query = SELECT * FROM enet WHERE TechContact LIKE '%' AND AdminContact LIKE '%'; This query simply prints out my entire tables, is there a way using PHP so I can make the '%' a user input so they can search the table under those fields. Cheers -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP linux interbase Apache
On Thursday 06 September 2001 13:31, Stephane MOREL wrote: Hi all I'm new on PHP. I've installed PHP interbase Apache correctly. But I would like to connect Interbase database through PHP. So I enable interbase support for php by doing this : ./configure --with-interbase --with-apache --enabled-track-vars if you compile with --with-apache, you'll have to recompile apache too. You can compile it as a shared module --with-apxs=path to your apxs. Note: you'll need Apache development stuff (Depends on your distro). Any way after running make install make sure you've restarted Apache. make make install Evreything works fine When I do this : ? $conn=ibase_connect(192.168.2.2:/opt/interbase/examples/employee.gdb, SYSDBA, masterkey); if (!$conn) { echo Access Denied!; exit; } ? my browser say :Call to undifined function :ibase_connect. I understood that I must enable the extension in php.ini. I think the extension was automatically added to my php.ini but I can not find any entry in php.ini for interbase. If someone could help TIA Steph -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MYSQL/PHP what is the difference between unset() and mysql_free_result() ?
You free-up the dataspace pointed-to by $string with unset(). PHP knows that this variable points-to character data or numeric or whatever. unset() then releases the dataspace held by the $string itself and erases its name from the symbol table. Using mysql_free_result($string) will not work because $string does not point-to a result returned from a mysql_query(). After executing mysql_free_result($result), $result still exists in the symbol table. You would have to unset($result) to delete the pointer itself. -Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 05, 2001 4:46 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MYSQL/PHP what is the difference between unset() and mysql_free_result() ? Hello, unset() simply deletes the pointer to the data without releasing the space held by the data. mysql_free_result() releases the data storage pointed-to by the $result pointer. This is important because $result could be pointing-to a dataspace containing a large number or rows returned by the mysql_query(). You WANT to recover this dataspace. Well, oke, tnx. But if unset() doesn't releas the data-space, what then is it's functionality? only voor tests like: if(isset($var)) ;? And how can i free the data-space from a string or somting like that? b.e. $string=a very long string; free($string);#? #could i use mysql_free_result($string); Tnx, Bas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP linux interbase Apache
Thank you for your answer after a glance on the net I have found I need interbase.so. This is not present on my disk do you how can I retrieve it steph Meir Kriheli a écrit : On Thursday 06 September 2001 13:31, Stephane MOREL wrote: Hi all I'm new on PHP. I've installed PHP interbase Apache correctly. But I would like to connect Interbase database through PHP. So I enable interbase support for php by doing this : ./configure --with-interbase --with-apache --enabled-track-vars if you compile with --with-apache, you'll have to recompile apache too. You can compile it as a shared module --with-apxs=path to your apxs. Note: you'll need Apache development stuff (Depends on your distro). Any way after running make install make sure you've restarted Apache. make make install Evreything works fine When I do this : ? $conn=ibase_connect(192.168.2.2:/opt/interbase/examples/employee.gdb, SYSDBA, masterkey); if (!$conn) { echo Access Denied!; exit; } ? my browser say :Call to undifined function :ibase_connect. I understood that I must enable the extension in php.ini. I think the extension was automatically added to my php.ini but I can not find any entry in php.ini for interbase. If someone could help TIA Steph -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Table columns
Some does know ho to get column list using ODBC_COLUMNS functions? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP linux interbase Apache
On Thu, Sep 06, 2001 at 03:38:18PM +0100, Stephane MOREL wrote: Thank you for your answer after a glance on the net I have found I need interbase.so. This is not present on my disk do you how can I retrieve it steph How and where did you intsall interbase - it's been a while so I forget. I think the rpm version installs itself in /opt/interbase (you can check with rpm -ql interbase). If that is the case then you need to configure with ./configure --with-apxs=/path/to/apxs --with-interbase=/opt/interbase --enable-track-vars Paul Meir Kriheli a écrit : On Thursday 06 September 2001 13:31, Stephane MOREL wrote: Hi all I'm new on PHP. I've installed PHP interbase Apache correctly. But I would like to connect Interbase database through PHP. So I enable interbase support for php by doing this : ./configure --with-interbase --with-apache --enabled-track-vars if you compile with --with-apache, you'll have to recompile apache too. You can compile it as a shared module --with-apxs=path to your apxs. Note: you'll need Apache development stuff (Depends on your distro). Any way after running make install make sure you've restarted Apache. make make install Evreything works fine When I do this : ? $conn=ibase_connect(192.168.2.2:/opt/interbase/examples/employee.gdb, SYSDBA, masterkey); if (!$conn) { echo Access Denied!; exit; } ? my browser say :Call to undifined function :ibase_connect. I understood that I must enable the extension in php.ini. I think the extension was automatically added to my php.ini but I can not find any entry in php.ini for interbase. If someone could help TIA Steph -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- - Paul Cooper | Tel: 0121 331 7858 Senior Programmer and Database Engineer | Fax: 0121 331 7859 UCEcom | mailto:[EMAIL PROTECTED] University of Central England | http://www.ucecom.com Birmingham, B4 7DX | - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Backups, best practices
Hello, I'm just wondering how everyone manages their MySQL backups, I'm looking for a better solution than manual. any scripts or example would be especially appreciated. tnks -- Best regards, Jacob Singh Pajama Design (413)582-9342 2 Belanger Pl. Northampton, MA 01060 mailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP linux interbase Apache
Thank you for your answer Interbase is installed in /opt/interbase. I don't use --with-apxs. What I need now is to eanble connection to interbase through PHP. It seems to me I only need to compile PHP with the --with-interbase=/opt/interbase to create the file interbase.so.But I guess I'm wrong Thank you for your help steph Paul Cooper a écrit : On Thu, Sep 06, 2001 at 03:38:18PM +0100, Stephane MOREL wrote: Thank you for your answer after a glance on the net I have found I need interbase.so. This is not present on my disk do you how can I retrieve it steph How and where did you intsall interbase - it's been a while so I forget. I think the rpm version installs itself in /opt/interbase (you can check with rpm -ql interbase). If that is the case then you need to configure with ./configure --with-apxs=/path/to/apxs --with-interbase=/opt/interbase --enable-track-vars Paul Meir Kriheli a écrit : On Thursday 06 September 2001 13:31, Stephane MOREL wrote: Hi all I'm new on PHP. I've installed PHP interbase Apache correctly. But I would like to connect Interbase database through PHP. So I enable interbase support for php by doing this : ./configure --with-interbase --with-apache --enabled-track-vars if you compile with --with-apache, you'll have to recompile apache too. You can compile it as a shared module --with-apxs=path to your apxs. Note: you'll need Apache development stuff (Depends on your distro). Any way after running make install make sure you've restarted Apache. make make install Evreything works fine When I do this : ? $conn=ibase_connect(192.168.2.2:/opt/interbase/examples/employee.gdb, SYSDBA, masterkey); if (!$conn) { echo Access Denied!; exit; } ? my browser say :Call to undifined function :ibase_connect. I understood that I must enable the extension in php.ini. I think the extension was automatically added to my php.ini but I can not find any entry in php.ini for interbase. If someone could help TIA Steph -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- - Paul Cooper | Tel: 0121 331 7858 Senior Programmer and Database Engineer | Fax: 0121 331 7859 UCEcom | mailto:[EMAIL PROTECTED] University of Central England | http://www.ucecom.com Birmingham, B4 7DX | - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Backups, best practices
I use a script, written in Perl, that I run manually (but could be added to a cron tab): --- Starting of the script #!/usr/bin/perl print Starting...\n; ### Some variables $BASEDIR = /home/backup; $dump_path = /usr/bin/mysqldump; $date_path = /bin/date; # path to date $date_format = +%d%b%Y; # dateformat ddMonYear for file name $filedate = `$date_path $date_format`; chomp($filedate); $filedate =~ s/\s//g; # no spaces in there (like on the 1st of the month) # Dumping the databases print Dumping Databases...\n; exec mysqldump --all-databases --quick -uroot -p | gzip $BASEDIR/$filedate-MySQL.gz; print E finito!\n; --- End of the script This will ask you for the password of the user root (did you set this up? :) ) and pass the output to gzip that compress it. The final file is on the directory '/home/backup' and named '010101-MySQL.gz' (if you run the script the 1st of January of 2001). Of course, you could go further and do it progresively... This is quick and dirty, but it works! :) Regards, Tomás I'm just wondering how everyone manages their MySQL backups, I'm looking for a better solution than manual. any scripts or example would be especially appreciated. tnks +-- --+ Tomás García Ferrari Bigital http://bigital.com/ +-- --+ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] MYSQL/PHP what is the difference between unset() and mysql_free_result() ?
And how can i free the data-space from a string or somting like that? b.e. $string=a very long string; free($string);#? #could i use mysql_free_result($string); Maybe I can use: unset($string=); or unset($array=array()); to free the data-space also -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] SQL combine to summations queries?
Hello, I don't understand the following, who can help? I have got two queries: SELECT SUM(fielda) FROM table1 and SELECT SUM(fieldb) FROM table2 I thought this would be the same as: SELECT SUM(fielda.table1),SUM(fieldb.table2) FROM table1, table2. But, itn't, why? Tnx, Bas Jobsen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] SQL combine to summations queries?
Hello, I don't understand the following, who can help? I have got two queries: SELECT SUM(fielda) FROM table1 and SELECT SUM(fieldb) FROM table2 I thought this would be the same as: SELECT SUM(fielda.table1),SUM(fieldb.table2) FROM table1, table2. But, itn't, why? I think you mean table1.fielda rather than fielda.table1. Tnx, Bas Jobsen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MYSQL/PHP what is the difference between unset() and mysql_free_result() ?
nope. see my previous reply -Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 06, 2001 10:11 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MYSQL/PHP what is the difference between unset() and mysql_free_result() ? And how can i free the data-space from a string or somting like that? b.e. $string=a very long string; free($string);#? #could i use mysql_free_result($string); Maybe I can use: unset($string=); or unset($array=array()); to free the data-space also -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] SQL combine to summations queries?
Hello, I don't understand the following, who can help? I have got two queries: SELECT SUM(fielda) FROM table1 and SELECT SUM(fieldb) FROM table2 I thought this would be the same as: SELECT SUM(fielda.table1),SUM(fieldb.table2) FROM table1, table2. But, itn't, why? Tnx, Bas Jobsen You have to remember the table1,table2 is the same as table1 JOIN table2. What does this mean? Try this code and I think you will get a better idea of what is happening Select table1.fielda,table2.fieldb from table1,table2; Say table1.fielda is an int with values 1-5 and table2.fieldb is an int with values 1-7. The above Select would return 35 rows, because the join (,) tells it to return a set with every combination of fielda and fieldb (1,1 2,1 3,1 4,1 5,1 1,2 etc) So SELECT SUM(fielda.table1),SUM(fieldb.table2) FROM table1, table2. Will calculate every possible combination of fielda and fieldb and then give you the sums of each column in that set (105 and 140 in my example). Does that make sense? To do what I think you are trying to do you would use something like: Select sum(table1.fielda),sum(table2.fieldb) from table1 LEFT JOIN table2 ON table1.id=table2.id; if table1.fielda has more rows. If table2.fieldb has more rows use: Select sum(table1.fielda),sum(table2.fieldb) from table2 LEFT JOIN table1 ON table1.id=table2.id; Hope that helps Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] SQL combine to summations queries?
To do what I think you are trying to do you would use something like: Select sum(table1.fielda),sum(table2.fieldb) from table1 LEFT JOIN table2 ON table1.id=table2.id; if table1.fielda has more rows. If table2.fieldb has more rows use: the amount of rows is the same :) Select sum(table1.fielda),sum(table2.fieldb) from table2 LEFT JOIN table1 ON table1.id=table2.id; Hope that helps Yes, it does, TNX!!! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Backups, best practices
try mysqldump - Original Message - From: Jacob Singh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 10:22 PM Subject: [PHP-DB] Backups, best practices Hello, I'm just wondering how everyone manages their MySQL backups, I'm looking for a better solution than manual. any scripts or example would be especially appreciated. tnks -- Best regards, Jacob Singh Pajama Design (413)582-9342 2 Belanger Pl. Northampton, MA 01060 mailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] stored procedure -- SQL Server 2k
Hi, does anybody know to call an SP on a SQL Server 2k??? thanks Bona __ Visite http://www.trama.com.br -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Backups, best practices
Hey Hey Hey!!! That depends on what system your running!?!?!? I run LinuxPPC and use 3 ways 1. Bru Tape back system 2. At 12:00 AM the shell script runs and copies the files.. 3. Once a month I manually copy the files to a zip. Dan PS WindowsGood luck. On Thursday, September 6, 2001, at 09:22 AM, Jacob Singh wrote: Hello, I'm just wondering how everyone manages their MySQL backups, I'm looking for a better solution than manual. any scripts or example would be especially appreciated. tnks -- Best regards, Jacob Singh Pajama Design (413)582-9342 2 Belanger Pl. Northampton, MA 01060 mailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP linux interbase Apache
On Thursday 06 September 2001 18:47, Stephane MOREL wrote: Thank you for your answer Interbase is installed in /opt/interbase. I don't use --with-apxs. What I need now is to eanble connection to interbase through PHP. It seems to me I only need to compile PHP with the --with-interbase=/opt/interbase to create the file interbase.so.But I guess I'm wrong Thank you for your help It all depends on how you install PHP (assuming you're using Apache) --with-apache : static PHP compiled into apache (needs to cmpile Apache) --with-apxs: dynamic apache module (no need to compile Apache) without any of them : compiled as a standalone cgi executable As for compiling with interbase: --with-interbase=/opt/interbase won't create the interbase.so file, but rather compile PHP with interbase support built into it. If you want the shared interbase module (.so) you should compile with: --with-interbase=shared,/opt/interbase and modify your php.ini I suggest you read the relevant pages in the manual. Find them at http://www.php.net/manual/en/install.unix.php http://www.php.net/manual/en/install.configure.php -- Meir Kriheli steph Paul Cooper a écrit : On Thu, Sep 06, 2001 at 03:38:18PM +0100, Stephane MOREL wrote: Thank you for your answer after a glance on the net I have found I need interbase.so. This is not present on my disk do you how can I retrieve it steph How and where did you intsall interbase - it's been a while so I forget. I think the rpm version installs itself in /opt/interbase (you can check with rpm -ql interbase). If that is the case then you need to configure with ./configure --with-apxs=/path/to/apxs --with-interbase=/opt/interbase --enable-track-vars Paul Meir Kriheli a écrit : On Thursday 06 September 2001 13:31, Stephane MOREL wrote: Hi all I'm new on PHP. I've installed PHP interbase Apache correctly. But I would like to connect Interbase database through PHP. So I enable interbase support for php by doing this : ./configure --with-interbase --with-apache --enabled-track-vars if you compile with --with-apache, you'll have to recompile apache too. You can compile it as a shared module --with-apxs=path to your apxs. Note: you'll need Apache development stuff (Depends on your distro). Any way after running make install make sure you've restarted Apache. make make install Evreything works fine When I do this : ? $conn=ibase_connect(192.168.2.2:/opt/interbase/examples/employee.g db, SYSDBA, masterkey); if (!$conn) { echo Access Denied!; exit; } ? my browser say :Call to undifined function :ibase_connect. I understood that I must enable the extension in php.ini. I think the extension was automatically added to my php.ini but I can not find any entry in php.ini for interbase. If someone could help TIA Steph -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- - Paul Cooper | Tel: 0121 331 7858 Senior Programmer and Database Engineer | Fax: 0121 331 7859 UCEcom | mailto:[EMAIL PROTECTED] University of Central England | http://www.ucecom.com Birmingham, B4 7DX | - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Table Search ... HELP
Below is an example of my code which searches a table and prints the result, the problem is that it only displays the TechContact where I want it to display all the fields that associated with it in that row off the colum eg. Mobile, AdminContact etc etc Any suggestions? if ($TechContact == ) {$TechContact = '%';} $result = mysql_query (SELECT * FROM enet WHERE TechContact LIKE '$TechContact%'); print $row[TechContact]; -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Converting a FoxPro database to mySQL
Is it possible? Is there any ready php script that does that? I only need the info that is stored in a DBF file - that I can easily access trough PHP's DBF functions and the info stored in a FPT (???) file. And, oh, I need that the client uploads the files from time to time, so that's why I asked for a resdy script. So I can trigger this script every time the client uploads the files... Please, folks tell me that there's a simple way to do it. I'm strongly trying to avoid the use of ADODBC. I'm not saying that is a bad thing, but I really prefer a Linux server than a MS one... Please help. Thanks in advance, -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Table Search ... HELP
All the info you want should be in $result after the query. But to get it out of $result you need to access one row at a time with mysql_fetch_array($result), which returns a numerically keyed array (if I remember correctly), or mysql_fetch_assoc($result), which returns a string keyed array or hash. So, like this (more or less)... if ($TechContact == ){ $TechContact = '%'; } $result = mysql_query (SELECT * FROM enet WHERE TechContact LIKE '$TechContact%'); // this part added... while($row = mysql_fetch_assoc($result)){ print $row[TechContact]; print $row[SomeOtherColumnName]; print $row[YetAnotherColumnName]; print br\n; } On 2001.09.06 19:41:55 -0500 Devon wrote: Below is an example of my code which searches a table and prints the result, the problem is that it only displays the TechContact where I want it to display all the fields that associated with it in that row off the colum eg. Mobile, AdminContact etc etc Any suggestions? if ($TechContact == ) {$TechContact = '%';} $result = mysql_query (SELECT * FROM enet WHERE TechContact LIKE '$TechContact%'); print $row[TechContact]; -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Does PHP work with Sybase ASA?
I mean, is there in PHP support for Sybase Adaptive Server Anywhere, any version, like for MySQL and some other databases? Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]