Re: [PHP-DB] Efficient way to access MS SQL server
charlie wrote: The native SQL driver for PHP has a problem with a limit on the number of characters in a string, so can't use that. hmmm interesting. how much is the limit? i used PHP's mssql_* functions and while i only used about 20 chars on a character search string in the WHERE, i found them to be as simple as the mysql_* functions... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: backup of database record before update
Stephen Sunderlin wrote: Neil, Have you had success with triggers. I couldn't get one to work and then saw discussion on the board here that MYSQL triggers were not so reliable and still somewhat problematic so I archive through the application. Just curious. i have used a couple simple triggers on a 5.0.20nt box. one thing i read recently is triggers and stored procedures do use more system resources though... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] What is the most efficient way to store SELECT results
Robert Palmer wrote: I'm not I was clear in my question. A query returns 1,000 rows from the table. I want to store the entire result of that query in order to be able to create separate pages to return the results rather than all on one page e.g. Page 1 2 3 4 ... . Not sure if it's important but I'm using persistent connections. test out your server. create a test script to load the results into an array. keep track of memory usage. then calculate that to how much traffic that script will be seeing. so taking that into consideration, if you run separate boxes for your web server/php and db, you can balance out: lots of hits on memory on the web server or lots of disc access on the db server if you decide to go with the re-call the db server paging methods... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Looking for a small open-source PHP-DB app that utilize OOP.
check out UCCASS. not only oop, but smarty as well... http://www.bigredspark.com/survey.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Email Article, Print Article
[EMAIL PROTECTED] wrote: Hello, I am running an article-based site, where I would like to add two buttons: print this article and email this article. Does anyone know where I could look to find out how to program this code into my article.php page? anothing this is to use CSS to strip out all of the fancy tables and graphics and stuff in the printed page option. plus, i use this trick to read a site that separates the article into multipages. when you click on the PRINTED option, it dumps the whole article into a graphics free format... ;) -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] dbase and Debian
Ricardo Markiewicz wrote: Unfortunately, I can't convert the dbf files to SQL tables, so, i need dbase support in PHP :( connect via ODBC, perhaps? then ADOdb or PEAR it? -- Leo G. Divinagracia III [EMAIL PROTECTED] z -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem..
okay.. i'm stumped. what client libraries? using php 5, so is it php_mysql.dll??? i'm using a canned script, so i have to make the changes there too? i checked out the mysql help link. i even started the mysqld with the --old-passwords parameter... still getting the error... thanks... Bastien Koert wrote: Check the mysql website. Have you upgraded from 4.0x to 4.1 recently. If so you need to update the client libraries that come with mysql. There are significant protocol changes from 4.0x to 4.1. Bastien From: ian [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem.. Date: Mon, 08 Nov 2004 17:02:53 + Any body met this error? Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /usr/local/apache2/html/poems/browse.php on line 15 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leo G. Divinagracia III [EMAIL PROTECTED] z -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL backup software
Perry, Matthew (Fire Marshal's Office) wrote: Does anyone know a free MySQL backup program to schedule regular backups? mysql has the ADMINISTRATOR, well at least for win32... does timed backups. -- Leo G. Divinagracia III [EMAIL PROTECTED] z -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Generate Menu based on database structure
graeme wrote: Hi, Rather than writing a recursive function I'd suggest that you create a menu class and store each record as an object of the class. why reinvent the wheel: http://www.destroydrop.com/javascripts/tree/ -- Leo G. Divinagracia III [EMAIL PROTECTED] z -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] User Activities
balwantsingh wrote: hi may pls. help me i am using PHP and MYSQL. is there any command through which i can record which user modifiyed the data through which command (insert / update / delete etc.) on which time and date in a table in mysql. maybe you should describe your application or needs. reason is, MYSQL with PHP, usually, there is one account you create that allows a PHP script to do those commands. typically, this is a sub-account from the master or root account. you need to be familiar on how MYSQL manages its user accounts. now if this is a web application, then anyone in the world can run this application and unless you have a facility on your web site to login users, then this is what you can use throughout the life of the web session. for example, the phpBB web app, multiple people log into the bulletin board. but the account that is used to connect to the MYSQL (in this case) backend is a single account that is created when you first install phpBB. phpBB then uses this account to do all the work needed and logs that into a table so you know who posted (or edit or deleted) what post on the forum. you might be still thinking in the MS ACCESS mode. that is diff from the way MYSQL works. -- Leo G. Divinagracia III [EMAIL PROTECTED] z -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] HELP: best way to TEXT dump a MySQL table to a local file...
project i'm working with, his host died or something. but, the phpMyadmin (on that host) can NOT do a backup of 200mb table without running out of memory or something weird. so what is the best way to text dump the table? i thought i would (pseudo-code): open DB do while not EOF grab 1000 rows from DB write to a file on host www path filename = filename000 + 1 until EOF user would then FTP down the files to his machine. but i figured i could use the HEADER to send it to the user. i grabbed this from the HEADER help section: ?php $output_file = 'something.txt'; $content_len = 666; @ob_end_clean(); @ini_set('zlib.output_compression', 'Off'); header('Pragma: public'); header('Content-Transfer-Encoding: none'); header('Content-Type: application/octetstream; name=' . $output_file . ''); header('Content-Disposition: inline; filename=' . $output_file . ''); header(Content-length: $content_len); ? is that the best way to send the txt file to the user? thanks... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] HELP: best way to TEXT dump a MySQL table to a local file...
would be nice... but since this is a hosted site and no shell access or anything, i thought i would write the php script to dump the file to my web path... Ignatius Reilly wrote: Hi the Third, have you considered dumping the table into a text file? SELECT * FROM mytable INTO OUTFILE c:/... this (AFAI) does not cause memory issues Ignatius _ - Original Message - From: Leo G. Divinagracia III [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 10, 2004 11:39 AM Subject: [PHP-DB] HELP: best way to TEXT dump a MySQL table to a local file... project i'm working with, his host died or something. but, the phpMyadmin (on that host) can NOT do a backup of 200mb table without running out of memory or something weird. so what is the best way to text dump the table? i thought i would (pseudo-code): open DB do while not EOF grab 1000 rows from DB write to a file on host www path filename = filename000 + 1 until EOF user would then FTP down the files to his machine. but i figured i could use the HEADER to send it to the user. i grabbed this from the HEADER help section: ?php $output_file = 'something.txt'; $content_len = 666; @ob_end_clean(); @ini_set('zlib.output_compression', 'Off'); header('Pragma: public'); header('Content-Transfer-Encoding: none'); header('Content-Type: application/octetstream; name=' . $output_file . ''); header('Content-Disposition: inline; filename=' . $output_file . ''); header(Content-length: $content_len); ? is that the best way to send the txt file to the user? thanks... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leo G. Divinagracia III [EMAIL PROTECTED] z -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: [PHP] What's wrong with this IF statement?
if ($cat_id != 53 || $cat_id != 54 || $cat_id != 55 || $cat_id != 117 || $cat_id != 118 || $cat_id != 74) anyone else see the problem with the IN clause instead: ie. if !($cat in (53, 54, 55, 117, 118, 74))... makes building SQL statements much easier. especially with mutiple SELECTS in a pull down form object. -- Leo G. Divinagracia III [EMAIL PROTECTED] z -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] How to produce the report using PHP?
Rokasa wrote: Hi there, I want to produce the report using the PHP but I don't know the PHP command. Or is it any third party software that can be called by PHP to produce the report? Is it anybody out there can help me. gotta do it the old fashion way, by writing it yourself... or you can ODBC it, and use ms access and it's report writer. -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] php date manupulation functions
Rajesh Fowkar wrote: Hello, There seems to be very few date manupulation functions in php. In my php form I am displaying select combos for day, month and year. Now while updating the form I want to retrieve the date and take out day, month and year from that date and display the correct selection in the combo. I could not find any function like say day($dbdate); month($dbdate); year($dbdate); Am I missing something ? Is there anyway to accomplish the above ? or I will have to store these three values separatly in the database rather than as a date. yes, you are missing it. you need to do the opposite. first read this: http://www.php.net/manual/en/function.date.php and everything will become clear... btw, if the current date is jan 1, 2000, then $day = date (d); $month = date (m); $year = date (y); echo $day; // would return 01 echo $month; // would return 01 echo 4year; //would return 00 -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Design suggestions - performance improvement
Matthew Nock wrote: Hi all, I am currently building a site for a cinema to display session times, film synopsis' etc... I have built the database as follows: TABLE: film_detail FilmID FilmName FilmRunTime FilmRating FilmSynopsis etc... TABLE session_data session_ID session_filmID session_StartTime session_Date normalize the SESSION_DATA more. i would: table:film_date fd_id fd_filmid fd_date table: session_data sd_id sd_fd_id (- foreign key) sd_starttime psuedo code: print movie info for (movie) select fd_date from film_date where fd_filmid = filmID print fd_date for (filmID - fd_date) loop select sd_starttime from session_data where fd_id = sd_fd_id print sd_starttime end loop next fd_date next movie film_detail has a 1 to many to film_date film_date has a 1 to many to session_data -- --- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Help with MySQL
Rodrigo Corrêa wrote: I´m new with MySQL, i´m just wondering if there is a way to get the IP from a MySQL Server, since i acess this by localhost in the webserver even if you could, the MYSQL admin probably set your account to access your data with a LOCALHOST permission only... so if you try to access your data, the system would not let you in. this is common. -- --- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Enhancement of script
start with the easy part. to display 3 months at a time, just do a 3 cell table where each cell contains a month. assuming you can write code to do one month, how is 2, 3 or even more months that difficult? as for doing multiple days, either draw a month with check boxes on them. or have a pull down tool that can you do mutiple selections. Ray Healy (Data Net Services) wrote: Dear All I have recently downloaded a calendar from CST (which is no longer supported ) and I have made a few changes to the script. The calendar will be used to see when something is booked and you can assign messages to it as well which the general user cannot see. In this respects I have created 2 pages - welcome .php for the general viewer and admin_welcome for the updating of the calendar. What I would like to do is to be able to enter multiple dates in at the same time - either saying from a start date for so many days or from a start date to an end date. After spending hours looking at the code and in this forum I cannot seem to get it right - basically I cannot do it. I was wondering if someone could have a look and tell me where I am going wrong. I have attached the files to this email along with the mySQL table file in case another column needs to be added. You can see the script running at www.matrix-hosting.co.uk/prestige/welcome.php for the general view and www.matrix-hosting.co.uk/prestige/admin_welcome.php for the admin side. Any help would be appreciated Ray P.S. if any one also knows how to get it to display a 2 or 3 months at a time or even a year this would also be a bonus as I have tried to do this as well. -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] how to display tree structure from database???
Pierre-Alain Joye wrote: Hello, http://membres.lycos.fr/sqlpro/Tree/SQL_tree.htm provides a good way to store trees in a DB, docs are in french, nut sqlimages are universal. hth pa run this URL through the translator at http://babel.altavista.com and you have a 90-98% accurate translation. handy site to keep around... -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: securing directory tree and allowing PHP to work
bmw wrote: You could restrict autoindexing through apache's httpd.conf. Look it up in apache's manual. Milan This is not my personal web server. It is a remote ISP which provides PHP and MySQL support. I cannot control the HTTP or PHP server build configurations...They have autoindexing built into the Apache server. just add an .htaccess file in that directory saying no one but LOCALHOST has access to it... http://www.javascriptkit.com/howto/htaccess5.shtml -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Database question
Shiloh Madsen wrote: I was wondering if there were any good documents out there about good database design...I know the basics of creating tables, setting data types and such, and now i want to know how to use it to the best effect...generating logical, streamlined tables, etc. have you got a lifetime? seriously, just google it. say relational database design and start from there. or pick up some college text book on that subject As a side-related note, i have a few tables now that call for some data which could be quite lengthly, say 3-6 paragraphs worth of text. what would be the best data style and length for this kind of field? you can use either TEXT, MEDIUMTEXT or LONGTEXT. 64K, 16 million and 4 billion bytes, respectively... the downside is the space taken up when the actual data is less than the field size. then there's VARCHAR. the downside is that it's limited to 255 bytes... good news is that it's N+1 byte size. -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] authenticating methods...
i was curious as to which methods you are authenticating your users? for example, i'm using apache, mysql and php in a win2k box. i want to maintain my own table of users and authenticate from that. do you have a single user with just enough rights do a SELECT? and then have another account for the other tasks? or a single user that does everything including the INSERTS? and where are you storing the username and password? in the code itself or call it via the INCLUDE statement? thanks... -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] select distinct with all columns
you maybe using it the wrong way. read the doc: russ arbuthnot wrote: I have a mysql table named equipment with 11 columns named: id, staff_member, class, type, manufacturer, model, description, picture, created, modified, and published. I'm trying to write a select statement similar to this: SELECT DISTINCT type FROM equipement WHERE class = microphones; yet shows all 11 columns of the selected rows rather than just the type column. The only way I know how to show all the columns is to use SELECT *, or to list all the columns manually like SELECT id, type, class, ... etc. But when I tried doing this: SELECT DISTINCT type, id, staff_member, class, manufacturer, model, description, picture, created, modified, published FROM equipment WHERE class = microphones; I just got the exact same answer as if i would have done this: SELECT * FROM equipment WHERE class = microphones; so it didn't help. Can anyone offer a hint? Thanks, russ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] oops...Re: [PHP-DB] select distinct with all columns
oops, i accidentally sent it without finishing... anyway, what i wanted to say was DISTINCT, at least how i learned it, was working with rows instead of colums: http://www.mysql.com/doc/en/DISTINCT_optimisation.html is there a reason why you dont want to list the columns? russ arbuthnot wrote: I have a mysql table named equipment with 11 columns named: id, staff_member, class, type, manufacturer, model, description, picture, created, modified, and published. I'm trying to write a select statement similar to this: SELECT DISTINCT type FROM equipement WHERE class = microphones; yet shows all 11 columns of the selected rows rather than just the type column. The only way I know how to show all the columns is to use SELECT *, or to list all the columns manually like SELECT id, type, class, ... etc. But when I tried doing this: SELECT DISTINCT type, id, staff_member, class, manufacturer, model, description, picture, created, modified, published FROM equipment WHERE class = microphones; I just got the exact same answer as if i would have done this: SELECT * FROM equipment WHERE class = microphones; so it didn't help. Can anyone offer a hint? Thanks, russ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] best way to stare true, false
if you are storing a bunch of T/F, you can store 8 of them into a single byte... each bit position will represent one question... you just have to do some BIT manipulation on your end... andy wrote: Hi there, I am searching for the best way to store true or false inside a MySQL DB. With best I mean the most data efficient way and in the same time the best for fast searching later on the table to find all which are false, or true. I think I did read something about a way to do this with ENUM, but cant remember where and how, all tryes did not succeeed so far. -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] JOIN in embedded query
since you didnt list what type DB you are using, i assumed MYSQL. and MYSQL doesnt have sub SELECTs... :( http://www.mysql.com/doc/en/UPDATE.html the syntax lists ...WHERE where_condition... Michael Hendsbee wrote: UPDATE Emails SET Sent = 'T' WHERE ID = (SELECT Emails.ID FROM Emails RIGHT JOIN KeyWords ON Emails.ID = KeyWords.EmailsID) LIMIT 250 I am getting an error, and I am quite certain that it is my syntax -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Help Needed
you need a second REQUIRED parameter: mysql_result (PHP 3, PHP 4 ) mysql_result -- Get result data Description mixed mysql_result ( resource result, int row [, mixed field]) as copied from php's doc site... http://www.php.net/manual/en/function.mysql-result.php Manoj Japher wrote: hi, I have started working with PHP-MySQL recently. I have been getting a warning message which i am not able to debug. Could some one pls help me out? The message is Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/local/apache2/htdocs/verify.php on line 37 The code is @$db=mysql_pconnect(localhost:/var/lib/mysql/mysql.sock,,); if(!$db) { echo The Server is Busy. Please Try Later ; exit; } mysql_select_db(userinfo); $query = select * from userinfo; $mysql_results = mysql_query($query,$db); line 37:$num_result = mysql_num_rows($mysql_results); if($num_result == 0) { echo PInvalid Username or Password entered/P; exit; } Regards, Manoj 'I have miles to go before I sleep, and promises to keep' -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] 2 groups of random result pls help...
did you mean you need help with an sql query for this? sounds like select id, group, name from MYTABLE order by group; since i cant read your mind and you didnt specify anything else and since this is a php-db mailing list, hope that's what you are asking for... of course i could me a mile off... [EMAIL PROTECTED] wrote: Hi.. I need to get 2 groups of random result with 1 group always on top of the other. Can anyone help me with this please.. Something like id|group|name 21john 51smith 32 1sara 12 1michael 12don 92beth 42bob -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Comparison with formatted numbers
try the good ol' SETTYPE function to set the variable type from string to numeric and visa versa... http://www.php.net/manual/en/function.settype.php Terry Romine wrote: I've run into a sticky case where my query is failing (PHP4.x/MySQL). I have a table where the price value is imported from an external source, so I can't change it on the fly, and they embed thousands seperators (in my case ','). When I try to do a query such as .. where price = '25' .. if finds values that meet or exceed that value (returns some in the range of 2,500,000. I gather that it is failing because of the comma (the price field contains values of '2,500,000'). Is there a function that I can use to force the price format to integer before/during the query? Or would it work if I did a number_format on the test value? ie: '.. where price = '200,000' ..' Help would be appreciated. Terry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: please help.. serial number generator
use the MD5 function and just take the 1st 10 chars or better yet, once you have the MD5 value, use a wacky routine to take the first 10 odd position values... since each time you run the function, it will always return the same value (given the same string parameter...). [EMAIL PROTECTED] wrote: I need to create some kind of 10 digits serial number where I can generate and check that it is valid. Sort of like a checksum.. Jj Harrison [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if u are looking for a simple random string try this php: echo md5(time()); or md5() a random number your choice. md5() genetates a one way non-reversable hash. which could be kept in a db. here is an example of the md5 hash of my library card number: 11d560821fb027c227d837df53a5a73a md5() is often used to store passwords and make them non-viewable. if you are just looking for a unique number an auto-increment coloumn in mysql or what ever should do it. -- JJ Harrison [EMAIL PROTECTED] www.tececo.com Rainydays Sunshine [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Any ideas how to generate a unique serial number that you can check that it's valid.. Thanks... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connect to MySql DB on diferent domain
first, get a user account on that DB outside your domain. then when making the connections, just use that on the mysql_connection () function... should be no different that using LOCALHOST... the trick is the user account with the appropriate (and should be limited) rights... M. Couto wrote: Hi, Im using PHP 4.0 and MySQL and I have a PHP procedure on one site that need to connect to a MySql database outside this domain, I need to append records in a database on a different domain. How can I do this? I will apreciate if anyone give me some help or a simple example how to do this? -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] what's a GOOD starting HOURLY rate for a PHP/MYSQL job?
okay, you consultants... i'm gonna venture at work to do some side jobs here for some online dynamic web pages. but what would be a good starting pay rate? or would you contract for the entire job? what about a per PAGE/SCRIPT basis? thanks... -- Leo G. Divinagracia III [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] date
depends on how you are entering data... if through a client, then you have to format it as MYSQL wants it. if you're going through PHP (afterall, this is a PHP DB list... ;-)), then accept it anyway you wanna, through a form on a web page, then your script will handle the convertion on how MYSQL wants it... and yes, the date thing going from PHP to MYSQL and visa versa was a toughie for me to grasp. then i read a chapter on a book that made sense... ax wrote: if i unput the values 10/10/2001 into mysql database, would mysql or php recognize that as a date?? i am a bit confused. i inserted few dates in the above format and asked mysql to list them by date and it does not seem to work. any suggestions?? please :) ax -- Leo G. Divinagracia III [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] Backups, best practices
Beau Lebens wrote: // err.. please correct me if I'm wrong, but isn't pkzip // exactly that? or more // exactly, winzip is a windows interface to it? it certainly // uses the same // compression nope - you're right, i forgot about pkzip, but i was just saying that it's pretty strange that winzip is the biggest compression program used for windoze machines and they haven't released their own command-line version... last i heard it was still in the piplelines. and they probably never will... winzip took the opportunity that PKWARE didnt. winzip released a win interface to the ZIP compression scheme that Phil Katz wrote. and PKWARE never caught up to the popularity that winzip took. sadly, he died of alcoholic reasons. most people never knew him yet his code will live for a long time. trivia: the first two bytes of the any valid zip file? P and K... here's a frief history of the man: http://www.computeraddicts.com/pkzip.htm kinda sad, when i read in a PC MAG article a month or so ago when they celebrated 10 or so people that shaped the PC industry (or was influencial) in the last 20 years. one of persons is the porn king of the internet, and PK is left out... pkzip is made by a different company i think -- Leo G. Divinagracia III [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] USA Attacks (Nostradamus -- Further Info)
wow... i didnt know nostradomus used PHP with a database backend? otherwise, please don't post this stuff on this list... -- Leo G. Divinagracia III [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] Passing parameters to a PHP file.
u quick question, does VAR1 contain a value before the call??? could be null to begin with... Victor Espina wrote: I want to call a PHP file with some parameters. I tried this sintax: HREF=MyPage.PHP?Var1=Value1 But i don't seem to be receiving any value for Var1. I tested it with: print Var1: $Var1; and the output is Var1: What i'm missing here? -- == Victor Espina Caracas, Venezuela http://mitrompo.com/vespina [EMAIL PROTECTED] (Quite el 'nospam' para responder) (Remove 'nospam' to reply) -- 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] -- Leo G. Divinagracia III [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] problem with dbase connections using ODBC
boy, if i remember my old dbase days, dbase uses a table locking scheme. and a pessimistic locking style. if you are just querying the table, how about making a copy of it when a local user opens it and again, when they close it. your remote users will then query the copy... Don Jackson wrote: Windows NT 4.0 workstation Apache PHP 4 the following code works fine and returns the correct results... ? $connect = odbc_connect(partner,,); $query = SELECT company FROM listing; $result = odbc_exec($connect, $query); while(odbc_fetch_row($result)){ print odbc_result($result, company) . br; } odbc_close($connect); ? --- but if someone else is accessing the table (not exclusively) i get the error message. -- Warning: SQL error: [Microsoft][ODBC dBase Driver] The Microsoft Jet database engine cannot open the file 'N:\listing.DBF'. It is already opened exclusively by another user, or you need permission to view its data., SQL state S1000 in SQLExecDirect in c:\Program Files\Apache Group\Apache\htdocs/test.php on line 6 -- Is there a work around for this or a fix? I need to give internet access for this older internal database at the same time local users are accessing it. I've tried using ASP and PWS and it works but I really want to use PHP ; thanks in advance don -- 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] -- Leo G. Divinagracia III [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] search engine for database driven site?
1. use WYSIWYG html editor to make the initial HTM page with a search form with 2 text boxes. 2. the action for the form is the PHP page. 3. connect the two (using the variables in the sql query statement that's what i do... andrew hill wrote: Hi, Can anyone recommend either a general approach or sample scripts to create a search-box on my site? It's an existing site being dynamically generated from a database - I want to specify a couple of fields in my main page table to be searched on. cheers, duirfire _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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] -- Leo G. Divinagracia III [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] html generated web pages
still, you have to make a way for your website to store the preferences of each user/web visitor, right? you can save the info in text file, somewhere not in the WEB DOCS path. that way, hackers cant break your webserver and browse outside the normal web pages path. (hacker can break into the machine itself and peek around, but that's a diff subject) so now that that preferences are saved, all the user have to do is log in and when the web page is generated for them, the variables for the color settings, etc. is set. now, like what rick e. said, this will take hour(s) of coding. i cant even begin to give psuedo-code. 1. login 2. once logged in, setup script will read settings from somewhere, either a simple teext file or a database. 3. set web page color tags, images, etc. in variables. 4. generate HTML page from php scripts using said variables from #3 5. user is happy... you make millions... ;-) RSalomo wrote: i'm sorry but i don't quite understand here. yes, i'm looking for a theoritical (logical) answers or quick and dirty solutions. since i'm a newbie here. i guess i'll do more reading and searching. thank you very much rick, joe, olinux o and others for replying. rudy - Original Message - From: Rick Emery [EMAIL PROTECTED] Sent: Wednesday, September 05, 2001 19:55 Now...I understand. To accomplish what you want requires that you store user preferences in a database of some sorts. Then extract those preferences and insert them as HTML attributes to various tags. First, I would recommend that you use Cascading Style Sheets to set-up CLASSes and IDs for each user. Store those CSS elements in the user database and use them to generate your HTML. I don't know what database engine you have access to (MySQL, MSSQL, SYBASE,, etc), so you must learn the intricacies of the engine. I'm assuming PHP will be your server-side script engine. If you're looking for a quick and dirty solution from this list, I don't believe you'll get it. Rather, what you propose will take many hours of coding and testing. We can offer specific solutions to problems you encounter during design and development, though. Feel free to post those questions. -Original Message- From: RSalomo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 05, 2001 12:24 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] html generated web pages what i'm trying to do is how to control images and page format, color, fonts. so if i go to page a.html have image a.jpg and bgcolor red, if page b.html i have image b.jpg and bgcolor blue. and i can give to some users privileges, so they can change the image and the color easily through a userfriendly admin form. about the html generated web pages, i mean how php generates html-extension web pages (with image, contents and page format)? sorry my english is not very good. rudy -- Leo G. Divinagracia III [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] webpage counters
mysql will always have overhead. plus, IMO, mysql is overkill for just simple page counters. if i were you, keeping the text files outside the WEB DOC path would be better. they would have to crack into the machine itself... not just the web server... Eduardo Vela wrote: Hi: I have two types of counters in my web site and I would like to know which one is better. a) the first one using a field in mysql table and updating it each time a visitor hits the page. b) the second one using a plaint text file using code like this: ? $counter_file = counterfile.txt; $linecounter = file($counter_file); $linecounter[0]++; $cf = fopen($counter_file, w); fputs($cf, $linecounter[0]); fclose($cf); echo $linecounter[0]; ? in this case i had to change the permission of the file to: chmod 666 counterfile.txt My questions are: 1. Which is more efficient in terms of time, i.e. accessing a database or accessing a text file? 2. is the second counter secure? is there a possibility that the file counterfile.txt (with those permissions) can be used as a insecure door to my web server? -- Leo G. Divinagracia III [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] saving to two tables at the same time
CrossWalkCentral wrote: Question: I have a form of 1/2 customer data and the other 1/2 service info. that the custoemr fills out and when they submit it my php scrips adds the customer infor to the customer table but it will not add the service info to the service table? Any one have any ideas hmmm... lemme guess... previous M$ ACCESS user? where the forms did all the work for you? ;-))) simple enough... just do two insert statements. one for the cust table and one for the service table... ;-) i know, i know... access makes it easy... but trains the wrong stuff... ;-) -- Leo G. Divinagracia III [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] Problem with my first script
i havent tested it yet... but... Fernando Gonzalez wrote: $num=mysql_num_rows($result); $cur=1; while($num=$cur){ $myrow=mysql_fetch_array ($result); ^^ you got a space after the function and the open paren. NO SPACES (as i found before that took about 10 minutes of debugging on a similar debugging session...) ;-))) -- Leo G. Divinagracia III [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] Question regarding php and mysql with binary data...
the web page that is generated, does the HREF tag supply a name? and at least for my netscrape 4.7x, whenever i right click on an image, it uses that name on the dialog box that pops up, prompting me where and how to save it as... btw, why save images on a table? wouldnt saving the URL better? the pixs themselves would sit on separate folder or something... Koutsogiannopoulos Karolos wrote: Hello Again everyone... My question is simple... I have images submited IN my mysql Database. What i want is when i display them and i right click on them and choose save picture as i can get the name of the picture from the DB and not have to insert it my self. Does anyone now how can i do that with a file that comes from a db??? thanks ___ PGP KEY ID: 0xA86600E9 ___ -- Leo G. Divinagracia III [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] Problem with my first script
1. safe to assume that there is a column named nombre? 2. try using index numbers instead, i.e;, instead of $myrow(nombre), try $myrow(1)... Fernando Gonzalez wrote: Thanks, but it wont work. I have eliminate the space but still the same message. I have realized that the problem is below that line: the problem is pointing to the line where i fetch the first variable: $nombre=$myrow(nombre); -- Leo G. Divinagracia III [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] Access counter
in pseudo-code: make a text file - associate it a URL when a user comes along, have a PHP script on top of the web page to 1. open the text file 2. counter = counter +1 3. write update 3.5 print number of hits somewhere on webpage 4. close file... Shahmat Dahlan wrote: I'd like to do a counter with PHP, how do you do this? I thought maybe I could either use cookie or session or session? Which should I use ? regards and thanks is adnved -- 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] -- Leo G. Divinagracia III [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] config php w/ mysql
Darrell wrote: I got mysql installed on my win2000 machine, and have apache running with php 4 all working correctly. but I can't get php to work with the db... I'm pretty sure I can connect with mysql_connect(...) because it doesn't die at that spot. rather, when I try to do the mysql_query(...) it dies each time. how do I have to configure mysql or php to get them to communicate correctly? I know my query is correct because I can run it in mySQLGUI just fine... die... do you mean mean the result of mysql_query(...) is FALSE? check that result first? maybe the queries are returning no data or something... i mean if you can connect, then PHP and MySQL are working together just fine... i'd check the data first... -- Leo G. Divinagracia III [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] Monitoring No. OF CLICKS for a link
write a small script that you can include on each page. this script will update the field that holds the record for that page: update page_count_table set page_count=page_count+1 where url=$url_visited; Pranot Kokate wrote: Hi friends, I am using PHP - MySQL. I need a button which is basicaly a link to some page. So I want to track how many users click on the button or link, to view the page. Also how can I get the details about the person - like where is he located (country). Please help!!! regards, Pranot -- Leo G. Divinagracia III [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] multiple queries in one php statement....
cant... since the function returns a code if the call is true or not. if you try multiple statements, you cant know which failed and which was good... Koutsogiannopoulos Karolos wrote: Hello everyone... Could someone give me a tip ang tell me if i can insert more than one queries in a mysql_query() statement?? etc $quer=mysql_query( BEGIN WORK , QUERY 1 , QUERY 2, COMMIT,$db) Thanks. ___ PGP KEY ID: 0xA86600E9 ___ -- Leo G. Divinagracia III [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] Clock struggles
are you using the GMT time functions or localtime functions? gmmtime, gmdate and gmstrftime are all GMT time, localtime, mktime, strftime use local time... Taylor \Cody\ Fletcher wrote: Im running PHP off of Win2k. The clock on the server is set correctly, but somehow PHP timestamps are adding 7 hours to that. Is there a time zone property that needs to be changed? -- Leo G. Divinagracia III [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] Escaping
try using the SUBSTR function to check each string for the first char as a . if it does have it, strip and continue the process... Rankin, Randy wrote: Hello, I have a table in a MySQL DB (RH Linux/Apache) with a field called customer_name. Some of the customer names have an ampersand in them (ie; X X Supply). I am performing a select statement on this table to create a sales summary with customer name and total sales. This works fine; however, I am also creating a dynamic link on the customer name so that the user can click on it to get a detailed report of sales to that customer. This works great EXCEPT for the customers with ampersands in thier names. The result of clicking on these customers indicates a No Records found for X where X is the letter immediately preceding the ampersand. Does anyone know how to get around this? -- Leo G. Divinagracia III [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] Order by unix timestamp
try the RSORT (reserve sort) function??? Andreas Iwanowski wrote: Hello, i have a table where unix timestamps are inserted when adding a record. If i read out the table data, i want to order it by unixtime ( the name of the filed where the timestamp is ) He orders it by unixtime, but beginning with the oldest record. i thougt i could fix it by using ORDER by !unixtime . Also does'nt work How can i fix the problem that the records are ordered by unixtime, beginning with the newest record ? -- Leo G. Divinagracia III [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] I need a User Authentication solution
if you are using apache, you try the .htaccess file authorization technique... are you concerned about sending the username and password via plain text through the wire? if yes, then you may have to implement SSL on your server... David Coleman wrote: Hello, I'm looking for a complete User Authentication solution. Kind of like the ASP solution listed below: http://www.powerasp.com/content/code-snippets/advanced-password-protection.asp However, I'd like the solution to run on Linux w/ PHP and MySQL. Does anyone know of an off-the-shelf password protection script I could purchase? Or, can someone help me develop one. Thanks! -David -- 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] -- Leo G. Divinagracia III [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] Need a shopping cart
ummm... why not install MYSQL on your server? you can have the apache/mysql/php triad. all free/open sourced... then there are a few shopping carts already written. the book titled, PHP and MySQL Web Development has a shopping cart example... http://shop.barnesandnoble.com/booksearch/results.asp?WRD=PHP+and+MySQL+Web+Developmentuserid=17P90ZH208 Jeff @ HookedOnThe.Net wrote: Can anyone direct me to a shopping cart package (preferrably in PHP, although PERL would possibly work) which utilizes either an MS Access database or flat files? I've found several shopping carts, but they all seem to require MySQL which I do not have access to on my server. My server is Windows NT 4 with PHP 4 and PERL 5. I sure hope someone can help. Thanks in advance. Regards, Jeff [EMAIL PROTECTED] - ICQ UIN: 736807 Training, Web Hosting and Design http://www.HookedOnThe.Net -- 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] -- Leo G. Divinagracia III [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] New to PHP and MySQL
assuming you have a DB setup with a table for the guestbook, just do a standard query. now the steps can be long and wordy. but essentially, you open a connection to the DB server. you make a link to the DB. you then pass an SQL query via PHP to Mysql. then it stores the result into an array that you can then process. best thing to do is get a book that has PHP and Mysql into it. Beginning PHP from WROX.com had me started really well. then i got a PHP and Mysql book that just answered all my questions. [EMAIL PROTECTED] wrote: Hi there, I'm new to PHP and MySQL - coming from ACCESS and ASP. Can someone please let me know - in simple terms :-) how to search a DB? I have written a guestbook which works fine, but I would like my users to be able to search it for a word or phrase and i'm not totally sure how to go about it. Thanks for any and all help anyone :-) -- Leo G. Divinagracia III [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]