Re: [PHP-DB] Advice for dataupload
On Monday 08 April 2002 19:15, Michael Andersson wrote: What happens to a blob field with lets say a image when dumping a mysql table to a file? I don't use BLOB fields. You try it and let me know ;-) 3) Install phpMyAdmin on both machines. How do i replicate 2 mysql db:s with phpmyadmin? Have you actually installed it yet? It's pretty straightforward and self-explanatory. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Your best consolation is the hope that the things you failed to get weren't really worth having. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: security/setup question: php3 script contains db password, but scriptmust be readable by nobody: any solution?
The only answer I know is in the php config, which you may not have acces to. php can be configured to run as the owner of the script that calls it. This means only your scripts can read your files. This is not the default option, and most ISPs just run the default, so your password is available to anybody skilled enough to find it. http://www.php.net/manual/en/features.safe-mode.php should help HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- -Original Message- From: Michael Andersson [mailto:[EMAIL PROTECTED]] Sent: 04 April 2002 11:55 To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: security/setup question: php3 script contains db password, but scriptmust be readable by nobody: any solution? you could always use a sepeate file and and then use include (path/to/whateverfile.php); with all your dc connection prefererences in it... Dries Verachtert [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED]. kuleuven.a c.be... Hello, I use apache with php3 and mysql to get some data out of the mysql database like probably lotsa people do. The php3 file contains the password, because it must be able to connect to the database with a valid password. This file also needs to be readable because nobody (the user of the apache webserver) must be able to read the file. At least i think this is the reason because without a chmod o+r it doesn't work. There are ca. 200 users on this machine.. so i would like to avoid the possibility that other users get this password. Are there any solutions? I already checked the faq and i couldn't find it. Thanx in advance, Dries Verachtert -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Local to Global Variables
guessing here, but have you tried to use include'filename.txt' in your if statement? Eat Pasta Type Fasta [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Not 100% DB related but soon I am processing a text file by looking for strings which later depending on the findings will be submitted to db my problems is that in one if statemant I find a piece of text and need another statment to use it later, but it seems that the variable declared to the found string remains local. Is there a way to set variables from within functions/if statements so they become available to all. Thnaks in advance R -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] count
Sorry, That's not right. This is what I really meant to say. SELECT COUNT(column) as somename FROM table; or Select count(ID) name from $table; Mike - Original Message - From: Allen, Ronald L CIV [EMAIL PROTECTED] To: Mike [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 6:52 AM Subject: RE: [PHP-DB] count Something like this Select sum(ID) name from $table; Where name is some name that I come up with? Ronald L. Allen (MCSE NT, MCP, CCNA) SR. LAN/WAN Administrator SFOR - Hungary, Croatia [EMAIL PROTECTED] [EMAIL PROTECTED] +36-82-50 ext. 22580 DSN: 760-2000 -Original Message- From: Mike [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 12:54 To: Ron Allen Cc: php-db list Subject: Re: [PHP-DB] count SELECT SUM(column) as somename FROM table; Mike - Original Message - From: Ron Allen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 6:52 AM Subject: [PHP-DB] count I would like to count all the total records from a database. How would I go about doing that??? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: count
I know how to get the results for the total number of records select count(*) from $table but how do I put them into a variable for me to use later??? David Robley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I would like to count all the total records from a database. How would I go about doing that??? Do a COUNT * on each table and total the results? Although the results may actually not mean much depending on your DB structure. Or do you really mean count records in a _table_? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: count
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I know how to get the results for the total number of records select count(*) from $table but how do I put them into a variable for me to use later??? David Robley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I would like to count all the total records from a database. How would I go about doing that??? Do a COUNT * on each table and total the results? Although the results may actually not mean much depending on your DB structure. Or do you really mean count records in a _table_? Aliases. SELECT COUNT(*) AS howmany FROM table Then use the variable $howmany -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: count
What is the Aliases used for??? Aliases. SELECT COUNT(*) AS howmany FROM table Then use the variable $howmany -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] need help on insert select statement
Hi there, I would like to copy data from one table to another. My code just inserts one record. Not all 20. Why? This is my try: insert into parks_new (country, province, park) select * from national_parks_us_imported Thanx for any help Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] how to notify admin by e-mail only once if mysql server is down
Hi there, I am wondering if it would be possible to set up a php application like this: If the mysql server is down notify by e-mail, but only once. Right now I am getting an e-mail per view if the server is down (might be lots of e-mails :-) thanx for any hint, Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] R: PHP Question
When the user post a message, proccess the queries on temp page and then redirect to a page where you display message to user. In this case if he hits reload button, php don't repeat queries. I thing it should work. Bye Moreno -Messaggio originale- Da: Nick Stuart [mailto:[EMAIL PROTECTED]] Inviato: giovedì 11 aprile 2002 16.14 A: [EMAIL PROTECTED] Oggetto: PHP Question Ok so this really doesnt have anything to do with MySQL but I thought this might be a good placeto ask. Ok heres the problem. I am constructing a Message Board with MySQL and php (was usingASP) and I dont want the user to reload/repost data. For example, say the user goes to post amessage, after they hit the post button it takes them to a temp page saying that there post wassuccesful with a link to go view the post. The problem arises if some one decides to hit thereload button. Because of the way I have the posting page setup it will reload the page and postthe message again! doh! Anyways, has anyone come up against a similar problem and found a way around it? Thanks in advance. -Nick - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Best way to not display frozen users?
I run a gaming website. Sometimes, I have to freeze users for one thing or another. But, since there are lots of tables involving users that get displayed to other users, they still get seen. One solution to this seems to be to have an array of frozen users in the header, which I check when displaying user-related things. Is this the best solution, and if it is, what is the best way to do it? Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Best way to not display frozen users?
on 4/11/02 11:14 AM, Leif K-Brooks at [EMAIL PROTECTED] wrote: I run a gaming website. Sometimes, I have to freeze users for one thing or another. But, since there are lots of tables involving users that get displayed to other users, they still get seen. One solution to this seems to be to have an array of frozen users in the header, which I check when displaying user-related things. Is this the best solution, and if it is, what is the best way to do it? Thanks! I forgot to say, I use a myaql database if that helps.
[PHP-DB] how to bring down the mysqlserver without getting an inconsistant db?
Hi there, I am wondering what would be the best way to update a db. I would like to bring down the server, but I am afraid to get an inconsistant state of data. What if someone is just registering on another db? Is there a way to flush and lock the whole db not just some tables? Thanx, Andy PS: what would be the best way to exchange data on a running server? For example... a db containing geodata should be updated, but the user db should be running ok -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] how to bring down the mysqlserver without getting an inconsistant db?
Get all table names in a db and lock them :show tables;; Andrey - Original Message - From: andy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 7:37 PM Subject: [PHP-DB] how to bring down the mysqlserver without getting an inconsistant db? Hi there, I am wondering what would be the best way to update a db. I would like to bring down the server, but I am afraid to get an inconsistant state of data. What if someone is just registering on another db? Is there a way to flush and lock the whole db not just some tables? Thanx, Andy PS: what would be the best way to exchange data on a running server? For example... a db containing geodata should be updated, but the user db should be running ok -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] how to bring down the mysqlserver without getting an inconsistant db?
Have in mind this : LOCK TABLES locks tables for the current thread. UNLOCK TABLES releases any locks held by the current thread. All tables that are locked by the current thread are automatically unlocked when the thread issues another LOCK TABLES, or when the connection to the server is closed. Andrey - Original Message - From: andy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 7:47 PM Subject: Re: [PHP-DB] how to bring down the mysqlserver without getting an inconsistant db? what if I have 50 tables?? Andrey Hristov [EMAIL PROTECTED] schrieb im Newsbeitrag 02f701c1e177$abd40040$0b01a8c0@ANDreY">news:02f701c1e177$abd40040$0b01a8c0@ANDreY... Get all table names in a db and lock them :show tables;; Andrey - Original Message - From: andy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 11, 2002 7:37 PM Subject: [PHP-DB] how to bring down the mysqlserver without getting an inconsistant db? Hi there, I am wondering what would be the best way to update a db. I would like to bring down the server, but I am afraid to get an inconsistant state of data. What if someone is just registering on another db? Is there a way to flush and lock the whole db not just some tables? Thanx, Andy PS: what would be the best way to exchange data on a running server? For example... a db containing geodata should be updated, but the user db should be running ok -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Upload Multiple Images
Hi all...kinda new to PHP and MySQL...anyhow, I have created the following table: CREATE TABLE images ( id smallint(6) NOT NULL auto_increment, image_title varchar(75) default NULL, image_src varchar(150) default NULL, PRIMARY KEY (id) ) TYPE=MyISAM; I have also created a form that allows me to upload one image at a time, but I would like to be able to upload SEVERAL images at once. Directory for images is: ./_images/(filenames) There are also some subdirectories. What can I do to make it so that I can upload all of the images in a directory (or at least more than one) without having to type each one in and submit it? Your help would be very much appreciated! Thanks, Brandon Paul -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Upload Multiple Images
brandon, you can only ever upload 1 file per file input box, but you can have more than one of these input fields per form. you might have something like input type=file name=file1 input type=file name=file2 input type=file name=file3 that way when you are processing (assuming PHP4+) you can use something like $HTTP_POST_FILES[file2][name] blah blah hope that helps. you will have to check, but i think the MAX_FILESIZE and post_max_filesize or (whatever they are) variables apply to the *whole* form, so if your MAX_FILESIZE var is set to 2meg, and you have 3 files uploading, then their total must not exceed 3meg (i think) HTH Beau // -Original Message- // From: Brandon Paul [mailto:[EMAIL PROTECTED]] // Sent: Friday, 12 April 2002 6:06 AM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Upload Multiple Images // // // Hi all...kinda new to PHP and MySQL...anyhow, I have created // the following // table: // // CREATE TABLE images ( // id smallint(6) NOT NULL auto_increment, // image_title varchar(75) default NULL, // image_src varchar(150) default NULL, // PRIMARY KEY (id) // ) TYPE=MyISAM; // // I have also created a form that allows me to upload one // image at a time, but // I would like to be able to upload SEVERAL images at once. // Directory for // images is: // // ./_images/(filenames) // // There are also some subdirectories. What can I do to make // it so that I can // upload all of the images in a directory (or at least more // than one) without // having to type each one in and submit it? // // Your help would be very much appreciated! // // Thanks, // // Brandon Paul // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: count
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... What is the Aliases used for??? Aliases. SELECT COUNT(*) AS howmany FROM table Then use the variable $howmany At this stage I refer you to The Fine (mysql) Manual - or anything on the SQL language. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Numeric value are coming in as halfs
I'm using PHP to read data from a file and dump it into an array, then I'mfeeding that array into mySQL transfer happens fine except that some the numeric values are halfed currenly I'm simply tweaking the output by going: (int) $player_data[16] = $player_data[16] * 2 / 10; the /10 is needed because it also adds a zero to the end (f*cking guy) this is the script: for ($i = 1; $i 34; $i++){ $order = fgets($fp, 100); $order_exploded = explode(=, $order); fwrite($this_fp, $order_exploded[1]); echo($order_exploded[1] . br); trim($order_exploded[1]); $player_data[$i] = $order_exploded[1]; the fwrite() part is just a remainder of old testing (acts as write confirm) the data comes in 'field=value' format hence explode and sh*t THanks in advance. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php