php-general Digest 16 Apr 2005 06:00:30 -0000 Issue 3400
php-general Digest 16 Apr 2005 06:00:30 - Issue 3400 Topics (messages 213153 through 213175): Re: dynamic image will not print properly 213153 by: DuSTiN KRySaK Re: Amazon/eBay API 213154 by: Matthew Fonda 213161 by: Warren Vail 213170 by: Manuel Lemos Setting permissions such that file can be included but not open directly 213155 by: Dasmeet Singh 213157 by: Mike 213159 by: Marek Kilimajer 213163 by: Philip Hallstrom 213175 by: Dasmeet Singh Mysql insert problems 213156 by: Frank Miller 213158 by: John Nichel 213162 by: Andy Pieters 213164 by: Philip Hallstrom Re: Streaming video BLOBs from MySQL 213160 by: Marek Kilimajer Re: php and linux shell script 213165 by: Andy Pieters create file download page for firefox using net-transport thru flashGot? 213166 by: Ginger Cheng con'td create file download page for firefox using net-transport thru flashGot? 213167 by: Ginger Cheng Font color 213168 by: Ryan A 213172 by: trlists.clayst.com 213173 by: trlists.clayst.com processing email 213169 by: Florin Andrei 213171 by: Manuel Lemos Determining array type 213174 by: NSK Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- I got it figured out finally! It is so stupid with what the issue was... My image was being created exactly as it should have been - and the code was fine. Now where my issue was: I had a line of code in there that was to prevent people from calling the script directly (had to be referred from a particular page). Well IE did not like that for printing. Even though the script acted exactly as it should have by design. I saved the image to my desktop to test it, and when opening in an image app - it would not even open (even though displaying fine in a browser). So I changed the file ext of the downloaded file to that of a text file and opened it... and what do you know - there was the error my php script generates when the page is not called properly. So I removed that line of code (completely irrelevant to the image itself) And win/IE could print like all the other browsers could. doh! Dustin On 14-Apr-05, at 5:41 PM, Richard Lynch wrote: You'd want to http://php.net/urlencode the text, then. ?php $text = This is an example!; $text_url = urlencode($text); $url = http://example.com/gd_script/text=$text_url/fool_ie.jpg;; ? On Wed, April 13, 2005 5:42 pm, DuSTiN KRySaK said: One thing I feel is important to point out before I keep banging my head off of the wall here... In the URL parameter that is sent to the file, the url parameter is just carrying text that is printed into the image. It is not actually the image name, or anything. The image is generated in the cstl file (which actually is the image - sends JPEG headers,etc) - with the text on it (grabbed from the URL parameter). d On 13-Apr-05, at 5:03 PM, Richard Lynch wrote: Yup. $_PATH['x'] for the items that look like this: .../x=42/ And $PATH (without the underscore) is a string concatenation of all elements (after the PHP script) that look like this /whatever/ So you might use something like a PHP script named 'scale' and then: http://example.com/scale/width=100/height=100/images/subdir/ bigpic.jpg and then you know that you want to scale the image in your images/subdir naemd bigpic.jpg down to 100x100 at maximum. You'll have: $_PATH['width'] - 100 $_PATH['height'] - 100 $PATH = '/images/subdir/bigpic.jpg' On Tue, April 12, 2005 6:21 pm, DuSTiN KRySaK said: And then all I should have to do is change my $_REQUESTS to $PATH in hte cstl file right? d On 12-Apr-05, at 5:46 PM, Richard Lynch wrote: On Mon, April 11, 2005 1:14 pm, DuSTiN KRySaK said: hey - thanks a lot for the code snip - I am trying to use it now Just to confirm - the $path include file is included in the file that calls the cstl file - correct? Yes. Something like: ?php require 'pathinfo.inc'; ? You can use this same technique for not just JPEG, but also PDF, SWF (Ming) and FDF files, all of which Microsoft will screw up if you don't fool them with a URL that looks like static content. d On 5-Apr-05, at 5:57 PM, Richard Lynch wrote: On Tue, April 5, 2005 2:26 pm, DuSTiN KRySaK said: Hi there - I had my first crack at creating a dynamic image. The thing is - the image is displayed fine in the browser, but when you go to print it, the image is either missing, or part of it is missing. Is there something special needed to print a dynamic image? What you did, *should* work just fine. But we're talking *MICROSOFT* here! These people do *NOT* follow standards. Period. Here is a code snippet used
php-general Digest 16 Apr 2005 18:59:57 -0000 Issue 3401
php-general Digest 16 Apr 2005 18:59:57 - Issue 3401 Topics (messages 213176 through 213210): Are sessions unreliable? 213176 by: Dasmeet Singh 213177 by: Warren Vail 213182 by: Dasmeet Singh 213200 by: Matthew Weier O'Phinney Re: Any experience with multi-language PHP sites? 213178 by: Burhan Khalid 213189 by: Marek Kilimajer Chat Script 213179 by: sukalyan banga 213210 by: Dasmeet Singh Re: snort database not appearing in phpmyadmin 213180 by: Burhan Khalid Re: Sessions and frames 213181 by: Gustav Wiberg Re: Determining array type 213183 by: zini10 213184 by: Burhan Khalid Re: Mysql insert problems 213185 by: Burhan Khalid A question 213186 by: Khorosh Irani 213187 by: Amir Mohammad Saied 213191 by: Khorosh Irani 213195 by: Rory Browne 213203 by: trlists.clayst.com Access Denied-phpMyAdmin 213188 by: Mark Sargent 213190 by: Marek Kilimajer 213192 by: Mark Sargent 213194 by: Andre Dubuc forwarding email messages directly from a maildir 213193 by: mbneto Two tables (Slightly 0T) 213196 by: Ryan A 213197 by: Petar Nedyalkov 213198 by: Ryan A 213199 by: Matthew Weier O'Phinney 213201 by: Ryan A reducing array size 213202 by: pete M 213206 by: Jason Wong round? 213204 by: Chris Knipe 213205 by: trlists.clayst.com query error 213207 by: pete M 213208 by: Satyam trying to send mail via localhost 213209 by: AndreaD Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- Hi! I store some user info in sessions.. it works fine but sometimes what happens is that the user id stored in session get changed.. and it happens only sometimes.. Can it be browser problem? or this is common? Thanks - Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free-cpanel-web-hosting/ ---End Message--- ---BeginMessage--- I have had similar things happen but in every case it turned out to be a program bug in my code. It was usually something I looked at over and over and I saw the way it was supposed to work, but because I missed a detail it was not working that way. I would suggest you find someone to look over your code and help you with the debug process. I found many bugs just trying to explain to someone clearly how it worked. I suppose it could be a browser problem, but you need to solve those as well, or at least handle them gracefully. Do you make it a practice of having multiple browser instances open at the same time. I believe they will each normally get their own session key, and if you get your hands crossed, you will be looking at the symptoms in the wrong browser, bottom line, test, test, and test, then get a second set of eyes to look at your code, show them how it works, they don't need to really know a lot about PHP, or even programming for that matter, they will ask questions that as you try to answer them, you will find your problems. I have never found a legitimate bug in PHP Sessions, I have on the other hand found I was inconsistently using session handler routines, and before register globals was turned off, I was finding form variables that clobbered my session variables (or maybe it was the other way). Good Luck, Warren Vail [EMAIL PROTECTED] -Original Message- From: Dasmeet Singh [mailto:[EMAIL PROTECTED] Sent: Friday, April 15, 2005 11:04 PM To: php-general@lists.php.net Subject: [PHP] Are sessions unreliable? Hi! I store some user info in sessions.. it works fine but sometimes what happens is that the user id stored in session get changed.. and it happens only sometimes.. Can it be browser problem? or this is common? Thanks - Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free- cpanel-web-hosting/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Hi! Warren Thanks for such a detailed reply... I am already looking into the code... Just wanted to ask... I recently updated Red Hat's kernel.. and this problem seems to started appearing after that... is there a possibility of any connection between these two? Warren Vail wrote: I have had similar things happen but in every case it turned out to be a program bug in my code. It was usually something I looked at over and over and I saw the way it was supposed to work, but because I missed a detail it was not working that way. I would suggest you find someone to look over your code and help you
[PHP] Re: Setting permissions such that file can be included but not open directly
Dasmeet Singh wrote: Hi! I use a page to authorize a user and based on certain criterias (user group etc) include a file in another directory (named private)... Everything is working fine but the problem is anyone goign directly to private/includefile.php can run the script without authorising themselves... Is it possible to set folder permission such that files inside it cant be open directly but could be included? thanks in advance :) .htaccess thing worked ..Thanks :) Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free-cpanel-web-hosting/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Are sessions unreliable?
Hi! I store some user info in sessions.. it works fine but sometimes what happens is that the user id stored in session get changed.. and it happens only sometimes.. Can it be browser problem? or this is common? Thanks - Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free-cpanel-web-hosting/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Are sessions unreliable?
I have had similar things happen but in every case it turned out to be a program bug in my code. It was usually something I looked at over and over and I saw the way it was supposed to work, but because I missed a detail it was not working that way. I would suggest you find someone to look over your code and help you with the debug process. I found many bugs just trying to explain to someone clearly how it worked. I suppose it could be a browser problem, but you need to solve those as well, or at least handle them gracefully. Do you make it a practice of having multiple browser instances open at the same time. I believe they will each normally get their own session key, and if you get your hands crossed, you will be looking at the symptoms in the wrong browser, bottom line, test, test, and test, then get a second set of eyes to look at your code, show them how it works, they don't need to really know a lot about PHP, or even programming for that matter, they will ask questions that as you try to answer them, you will find your problems. I have never found a legitimate bug in PHP Sessions, I have on the other hand found I was inconsistently using session handler routines, and before register globals was turned off, I was finding form variables that clobbered my session variables (or maybe it was the other way). Good Luck, Warren Vail [EMAIL PROTECTED] -Original Message- From: Dasmeet Singh [mailto:[EMAIL PROTECTED] Sent: Friday, April 15, 2005 11:04 PM To: php-general@lists.php.net Subject: [PHP] Are sessions unreliable? Hi! I store some user info in sessions.. it works fine but sometimes what happens is that the user id stored in session get changed.. and it happens only sometimes.. Can it be browser problem? or this is common? Thanks - Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free- cpanel-web-hosting/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any experience with multi-language PHP sites?
Richard Davey wrote: Hi all, [ snipped ] I'm interested in knowing of any problems I should be looking out for while designing this - what happens to Japanese characters for example when stored in a MySQL text field? Any issues re: displaying them again once extracted? Or on validating foreign data input on web forms? We develop a few multi-language websites here, but mostly dealing with two languages; our most complex site is in three languages. I can provide the following tips: 1. MySQL's default character set is latin1 -- you need to watch out for this when storing information because it will get garbled. Character sets and collations vary greatly depending on what version of MySQL you are using. I would suggest going over the character set section in the manual [ http://dev.mysql.com/doc/mysql/en/charset-server.html ] if you haven't already. 4.1 has most of the features you would need. 2. Text searching can be a bit of a pain. We were using a system that defaults to utf-8; and stored the information in MySQL. Our users were logging in from Windows, and their character set was windows-1256 -- so searches were turning up blank, till we converted the system to windows-1256. Don't ask me how/why, because I'm really not that good with all this character set stuff :) If you figure this out, please let me know. I've found that matching the character set of HTML to what is expected from your users is the best compromise when coming to display searching. 3. I'm not sure how you would go and validate foreign data input; as I have never had to do such myself (all our input was in English on the public side, and on the backend, it was manually verified). Best of luck on this one. Cheers, Burhan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Chat Script
Hi! I am finding a chat script from which I can use that script as a private chatting work at my own URL.
Re: [PHP] snort database not appearing in phpmyadmin
Mark Sargent wrote: Mark Sargent wrote: Hi All, I've installed phpmyadmin and have a snort database in mysql, but, it doesn't appear in phpmyadmin. I know it's there, because base is using it to display info from snort on the machine. Why wouldn't it appear in phpmyadmin. It appears with the same set up on my work test machine. What should I look for to fix this..? Cheers. Mark Sargent. Mark, This is not the phpmyadmin help list. Its is not the snort help list either. This list is for PHP (the language) related issues. Regards, Burhan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions and frames
Hi there! Thanx a lot, i thought it was like that, but I wasn't sure /G @varupiraten.se - Original Message - From: Chris W. Parker [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED]; PHP General php-general@lists.php.net Sent: Friday, April 15, 2005 1:26 AM Subject: RE: [PHP] Sessions and frames Gustav Wiberg mailto:[EMAIL PROTECTED] on Thursday, April 14, 2005 4:00 PM said: I have built my site into frames. I want to transfer a session-variable from my left frame to my right frame... How do I do this best? Thoughts? You do this best by setting some session data on one page (any page), and then accessing that same data on another page (any page). If both frame sources are within the same domain they both have access to the same session data. Chris. -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.11 - Release Date: 2005-04-14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Are sessions unreliable?
Hi! Warren Thanks for such a detailed reply... I am already looking into the code... Just wanted to ask... I recently updated Red Hat's kernel.. and this problem seems to started appearing after that... is there a possibility of any connection between these two? Warren Vail wrote: I have had similar things happen but in every case it turned out to be a program bug in my code. It was usually something I looked at over and over and I saw the way it was supposed to work, but because I missed a detail it was not working that way. I would suggest you find someone to look over your code and help you with the debug process. I found many bugs just trying to explain to someone clearly how it worked. I suppose it could be a browser problem, but you need to solve those as well, or at least handle them gracefully. Do you make it a practice of having multiple browser instances open at the same time. I believe they will each normally get their own session key, and if you get your hands crossed, you will be looking at the symptoms in the wrong browser, bottom line, test, test, and test, then get a second set of eyes to look at your code, show them how it works, they don't need to really know a lot about PHP, or even programming for that matter, they will ask questions that as you try to answer them, you will find your problems. I have never found a legitimate bug in PHP Sessions, I have on the other hand found I was inconsistently using session handler routines, and before register globals was turned off, I was finding form variables that clobbered my session variables (or maybe it was the other way). Good Luck, Warren Vail [EMAIL PROTECTED] -Original Message- From: Dasmeet Singh [mailto:[EMAIL PROTECTED] Sent: Friday, April 15, 2005 11:04 PM To: php-general@lists.php.net Subject: [PHP] Are sessions unreliable? Hi! I store some user info in sessions.. it works fine but sometimes what happens is that the user id stored in session get changed.. and it happens only sometimes.. Can it be browser problem? or this is common? Thanks - Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free- cpanel-web-hosting/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free-cpanel-web-hosting/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Determining array type
i dont think there is a pre-made function but u can use : (! --untested at all --! ) function determine_array($a) { $numric=0; $assoc=0; foreach($a as $index=$value) { if(is_numeric($index)){ $numric=1; } else{ $assoc=1; } } return $numric+$assoc*2; } then results should be: empty: 0 numric: 1 assoc : 2 num+assoc : 3 Nsk [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] We have two kinds of arrays in PHP: $array[name] = George $array[0] = George How can I determine (with a function returning true/false for example) which type of array I am working with? -- NSK (Nikolaos S. Karastathis) Personal Homepage at http://nsk.wikinerds.org/ Owner of http://portal.wikinerds.org Owner of http://www.nerdypc.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Determining array type
NSK wrote: We have two kinds of arrays in PHP: $array[name] = George $array[0] = George How can I determine (with a function returning true/false for example) which type of array I am working with? There aren't two kinds of arrays, there is only one array type: There are no different indexed and associative array types in PHP; there is only one array type, which can both contain integer and string indices. [ http://www.php.net/manual/en/language.types.array.php ] So, you can have an array like this: $array = array(hello, name = Burhan); If you just want to know if all keys are numeric, then you just do a check on the keys : $keys = array_keys(array(hello,name = Burhan, goodbye)); foreach($keys as $key) { /* put your check in here */ } Make sure you do a type-safe check ( === ) not ( == ) which is not type safe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql insert problems
Andy Pieters wrote: Hi Whilst you are searching the net, you might also want to search for 'sql injection'. This is no joke! Please use the mysql_escape_string on each variable you get from the user side. Use mysql_real_escape_string() instead. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A question
Hello How I can find that php is installed as cgi or as apache module? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: A question
phpinfo() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Access Denied-phpMyAdmin
Hi All, I can access the database from the terminal on Fedora 3, [EMAIL PROTECTED] bin]# ./mysql -h localhost -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 4.1.10a-standard Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql But, get the following error when accessing via phpMyAdmin with user as root and the correct password, phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server. |#1045 - Access denied for user 'root'@'localhost' (using password: YES) I don't understand this. What have I missed..? $cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin-2.6.1-pl3/'; $cfg['Servers'][$i]['user'] = 'root'; // MySQL user $cfg['Servers'][$i]['password'] = 'password is correct'; // MySQL password (only needed | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any experience with multi-language PHP sites?
Burhan Khalid wrote: I've found that matching the character set of HTML to what is expected from your users is the best compromise when coming to display searching. This is a must, not a compromise. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Access Denied-phpMyAdmin
Mark Sargent wrote: Hi All, I can access the database from the terminal on Fedora 3, [EMAIL PROTECTED] bin]# ./mysql -h localhost -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 4.1.10a-standard Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql But, get the following error when accessing via phpMyAdmin with user as root and the correct password, phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server. |#1045 - Access denied for user 'root'@'localhost' (using password: YES) I don't understand this. What have I missed..? $cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin-2.6.1-pl3/'; $cfg['Servers'][$i]['user'] = 'root'; // MySQL user $cfg['Servers'][$i]['password'] = 'password is correct'; // MySQL password (only needed Change $cfg['Servers'][$i]['connect_type'], I guess it should be 'socket' in your setup -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: A question
How I can find it in phpinfo() ? On 4/16/05, Amir Mohammad Saied [EMAIL PROTECTED] wrote: phpinfo() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Access Denied-phpMyAdmin
Marek Kilimajer wrote: Mark Sargent wrote: Hi All, I can access the database from the terminal on Fedora 3, [EMAIL PROTECTED] bin]# ./mysql -h localhost -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 4.1.10a-standard Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql But, get the following error when accessing via phpMyAdmin with user as root and the correct password, phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server. |#1045 - Access denied for user 'root'@'localhost' (using password: YES) I don't understand this. What have I missed..? $cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin-2.6.1-pl3/'; $cfg['Servers'][$i]['user'] = 'root'; // MySQL user $cfg['Servers'][$i]['password'] = 'password is correct'; // MySQL password (only needed Change $cfg['Servers'][$i]['connect_type'], I guess it should be 'socket' in your setup Hi All, thanx, but, no difference. What I don't un, is, the setup is the same as another FC3 box, and it works. Cheers. Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] forwarding email messages directly from a maildir
Hi, I'd like to make a script that opens my maildir (~login/Maildir/.Junk/cur) and forwards all messages to a specific address in order to train the spam engine. Any tips about this ? tks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Access Denied-phpMyAdmin
On Saturday 16 April 2005 07:18 am, Mark Sargent wrote: Marek Kilimajer wrote: Mark Sargent wrote: Hi All, I can access the database from the terminal on Fedora 3, [EMAIL PROTECTED] bin]# ./mysql -h localhost -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 4.1.10a-standard Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql But, get the following error when accessing via phpMyAdmin with user as root and the correct password, phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server. |#1045 - Access denied for user 'root'@'localhost' (using password: YES) I don't understand this. What have I missed..? $cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin-2.6.1-pl3/'; $cfg['Servers'][$i]['user'] = 'root'; // MySQL user $cfg['Servers'][$i]['password'] = 'password is correct'; // MySQL password (only needed Change $cfg['Servers'][$i]['connect_type'], I guess it should be 'socket' in your setup Hi All, thanx, but, no difference. What I don't un, is, the setup is the same as another FC3 box, and it works. Cheers. Mark Sargent. Mark, I had the same problem. Try: $cfg['PmaAbsoluteUri'] = ''; /** * Disable the default warning about $cfg['PmaAbsoluteUri'] not being set * You should use this if and ONLY if the PmaAbsoluteUri auto-detection * works perfectly. */ $cfg['PmaAbsoluteUri_DisableWarning'] = FALSE; .. $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address Hth, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: A question
you write a script containing ?php phpinfo(); ? and ?php phpinfo(); ? only. You access that script through your web browser, and it will return a variety of useful information. Amongst it will be information labeled as SERVER API. If you are running as an apache module, Apache will appear in the box beside it. If you are using CGI, then CGI will appear there. On 4/16/05, Khorosh Irani [EMAIL PROTECTED] wrote: How I can find it in phpinfo() ? On 4/16/05, Amir Mohammad Saied [EMAIL PROTECTED] wrote: phpinfo() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Two tables (Slightly 0T)
Hey, My host has MySql 4.0.x so I cant really use the nested selects of 4.1 :-( please tell me how you solved something like this; I have two tables: users_online (username , dateandtime) users_details (cno, username, has_image, image_name) 1a) I have to select x records from users_online where $username is not more than 3 minutes old, 1b) then I have to check if that username has_image,if yes, get the imagename I thought of having the imagename also in the users_details, but we are allowing our members to change/modify their images at will What kind of sql do I use above? I dont want to run a query on every record returned from users_online as that would be really expensive. Thanks, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 4/16/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Two tables (Slightly 0T)
On Saturday 16 April 2005 17:06, Ryan A wrote: Hey, My host has MySql 4.0.x so I cant really use the nested selects of 4.1 :-( please tell me how you solved something like this; I have two tables: users_online (username , dateandtime) users_details (cno, username, has_image, image_name) 1a) I have to select x records from users_online where $username is not more than 3 minutes old, 1b) then I have to check if that username has_image,if yes, get the imagename I thought of having the imagename also in the users_details, but we are allowing our members to change/modify their images at will What kind of sql do I use above? I dont want to run a query on every record returned from users_online as that would be really expensive. See the JOIN syntax in MySQL. You can join the two tables. http://dev.mysql.com/doc/mysql/en/join.html BTW this is a question for the [MySQL General] list at [EMAIL PROTECTED] :-) Thanks, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 4/16/2005 -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 pgp6qozVxgQ3o.pgp Description: PGP signature
Re: [PHP] Two tables (Slightly 0T)
Hey, Thanks for replying. Will look up join. BTW this is a question for the [MySQL General] list at [EMAIL PROTECTED] I know its largly a MySql question, but I am using it via PHP...and thats why I wrote the OT in the subject...didnt want to tick anyone off. Cheers, Ryan On 4/16/2005 3:57:49 PM, [EMAIL PROTECTED] wrote: On Saturday 16 April 2005 17:06, Ryan A wrote: Hey, My host has MySql 4.0.x so I cant really use the nested selects of 4.1 :- ( please tell me how you solved something like this; I have two tables: users_online (username , dateandtime) users_details (cno, username, has_image, image_name) 1a) I have to select x records from users_online where $username is not more than 3 minutes old, 1b) then I have to check if that username has_image,if yes, get the imagename I thought of having the imagename also in the users_details, but we are allowing our members to change/modify their images at will What kind of sql do I use above? I dont want to run a query on every record returned from users_online as that would be really expensive. See the JOIN syntax in MySQL. You can join the two tables. -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 4/16/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Two tables (Slightly 0T)
* Ryan A [EMAIL PROTECTED]: My host has MySql 4.0.x so I cant really use the nested selects of 4.1 :-( please tell me how you solved something like this; I have two tables: users_online (username , dateandtime) users_details (cno, username, has_image, image_name) 1a) I have to select x records from users_online where $username is not more than 3 minutes old, 1b) then I have to check if that username has_image,if yes, get the imagename I thought of having the imagename also in the users_details, but we are allowing our members to change/modify their images at will What kind of sql do I use above? I dont want to run a query on every record returned from users_online as that would be really expensive. You're right, this is OT, but I'll answer anyways. You need to start brushing up on ANSI SQL, as this requires only a JOIN and a LIMIT: SELECT users_details.username, image_name FROM users_details INNER JOIN users_online ON users_online.username = users_details.username WHERE users_online.dateandtime ? AND has_image = 'yes' LIMIT x (where '?' is a date or timestamp 3 minutes in the past, and 'x' is the number of records you wish to select). -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Are sessions unreliable?
* Dasmeet Singh [EMAIL PROTECTED] : Just wanted to ask... I recently updated Red Hat's kernel.. and this problem seems to started appearing after that... is there a possibility of any connection between these two? Probably not, unless you're using shared memory for sessions. Warren Vail wrote: I have had similar things happen but in every case it turned out to be a program bug in my code. It was usually something I looked at over and over and I saw the way it was supposed to work, but because I missed a detail it was not working that way. I would suggest you find someone to look over your code and help you with the debug process. I found many bugs just trying to explain to someone clearly how it worked. I suppose it could be a browser problem, but you need to solve those as well, or at least handle them gracefully. Do you make it a practice of having multiple browser instances open at the same time. I believe they will each normally get their own session key, and if you get your hands crossed, you will be looking at the symptoms in the wrong browser, bottom line, test, test, and test, then get a second set of eyes to look at your code, show them how it works, they don't need to really know a lot about PHP, or even programming for that matter, they will ask questions that as you try to answer them, you will find your problems. I have never found a legitimate bug in PHP Sessions, I have on the other hand found I was inconsistently using session handler routines, and before register globals was turned off, I was finding form variables that clobbered my session variables (or maybe it was the other way). -Original Message- From: Dasmeet Singh [mailto:[EMAIL PROTECTED] Sent: Friday, April 15, 2005 11:04 PM To: php-general@lists.php.net Subject: [PHP] Are sessions unreliable? I store some user info in sessions.. it works fine but sometimes what happens is that the user id stored in session get changed.. and it happens only sometimes.. Can it be browser problem? or this is common? -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Two tables (Slightly 0T)
Hey, Thanks for replying. I know, I need to start brushing up on my Sql, problem is I rarely need to use much other than a simple select,update,insert. Sorry I didnt write my where query before...this is what i am using: SELECT last_online from `members_online` WHERE last_online DATE_sub(NOW(),INTERVAL 5 MINUTE ); Cheers, Ryan On 4/16/2005 4:29:27 PM, Matthew Weier O'Phinney ([EMAIL PROTECTED]) wrote: * Ryan A [EMAIL PROTECTED]: My host has MySql 4.0.x so I cant really use the nested selects of 4.1 :- ( please tell me how you solved something like this; I have two tables: users_online (username , dateandtime) users_details (cno, username, has_image, image_name) 1a) I have to select x records from users_online where $username is not more than 3 minutes old, 1b) then I have to check if that username has_image,if yes, get the imagename I thought of having the imagename also in the users_details, but we are allowing our members to change/modify their images at will What kind of sql do I use above? I dont want to run a query on every record returned from users_online as that would be really expensive. You're right, this is OT, but I'll answer anyways. -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 4/16/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reducing array size
Is there an easy way to trim an array ? I'm using array_unshift to push elemnts onto the front of an array but I want to limit the size to 20 ?? Is there an easy way to do this without looping and unsetting the elements ?? tia Pete -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: A question
On 16 Apr 2005 Khorosh Irani wrote: How I can find it in phpinfo() ? Another (simpler) approach is: echo php_sapi_name(); which will return 'cli', 'cgi', etc. -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] round?
Hi, I'm not sure if round() is what I am after. I want to round whole numbers to the closest 10 - thus, not decimals, etc. For example. 11.23 = 10 14.76 = 10 15.23 = 20 18.53 = 20 Thanks, -- Chris. I love deadlines. I especially love the whooshing sound they make as they fly by... - Douglas Adams, 'Hitchhiker's Guide to the Galaxy' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] round?
On 16 Apr 2005 Chris Knipe wrote: I'm not sure if round() is what I am after. I want to round whole numbers to the closest 10 - thus, not decimals, etc. Just use a precision of -1. For example round(125, -1) will return 130. -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reducing array size
On Saturday 16 April 2005 23:07, pete M wrote: Is there an easy way to trim an array ? I'm using array_unshift to push elemnts onto the front of an array but I want to limit the size to 20 ?? Is there an easy way to do this without looping and unsetting the elements ?? array_slice(), array_splice() -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] query error
I've got a database table with a whole list of windows file paths. eg Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Binder.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Excel.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Office Setup.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Outlook.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft PowerPoint.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Word.lnk Advent Tower PC\C\Program Files\Microsoft Office\MS Access Workgroup Administrator.lnk Advent Tower PC\C\Program Files\Microsoft Office\MSCREATE.DIR Advent Tower PC\C\Program Files\Microsoft Office\OF97SPEC.INI Advent Tower PC\C\Program Files\Microsoft Office\Office Advent Tower PC\C\Program Files\Microsoft Office\Office\1033 Now I want my DB query to search for directories .. here's a sample query select * from ff_files where full_path like 'Advent Tower PC\C\freeserve\help\images\%' doesnt work as the % is taken as a literal '%' I've aslso tried like 'Advent Tower PC\\C\\freeserve\\help\\images\%' I'm completely lost .. all I want is to return all rows that start with 'Advent Tower PC\C\freeserve\help\images\' tia Pete -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: query error
I believe the \ preceding the last % makes it a literal % not the wildcard % pete M [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've got a database table with a whole list of windows file paths. eg Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Binder.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Excel.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Office Setup.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Outlook.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft PowerPoint.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Word.lnk Advent Tower PC\C\Program Files\Microsoft Office\MS Access Workgroup Administrator.lnk Advent Tower PC\C\Program Files\Microsoft Office\MSCREATE.DIR Advent Tower PC\C\Program Files\Microsoft Office\OF97SPEC.INI Advent Tower PC\C\Program Files\Microsoft Office\Office Advent Tower PC\C\Program Files\Microsoft Office\Office\1033 Now I want my DB query to search for directories .. here's a sample query select * from ff_files where full_path like 'Advent Tower PC\C\freeserve\help\images\%' doesnt work as the % is taken as a literal '%' I've aslso tried like 'Advent Tower PC\\C\\freeserve\\help\\images\%' I'm completely lost .. all I want is to return all rows that start with 'Advent Tower PC\C\freeserve\help\images\' tia Pete -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] trying to send mail via localhost
When trying to send mail via localhost I get the following error Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Any ideas?/ RH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Chat Script
Sukalyan Banga wrote: Hi! I am finding a chat script from which I can use that script as a private chatting work at my own URL. see this :) http://www.hotscripts.com/PHP/Scripts_and_Programs/Chat_Scripts/index.html - Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free-cpanel-web-hosting/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image handling
I have a form on my website that allows users to upload photographs.. 1. How to find out the file type they are uploading..like jpeg or png or gif? 2. Also is there any way to find out size and resolution of the image? Thanks in advance :) - Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free-cpanel-web-hosting/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: trying to send mail via localhost
I think the specs are in RFC 822. You should find if there. Satyam AndreaD [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] When trying to send mail via localhost I get the following error Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Any ideas?/ RH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image handling
On 4/16/05, Dasmeet Singh [EMAIL PROTECTED] wrote: I have a form on my website that allows users to upload photographs.. 1. How to find out the file type they are uploading..like jpeg or png or gif? 2. Also is there any way to find out size and resolution of the image? http://us3.php.net/manual/en/function.getimagesize.php You can use getimagesize to get the size and type of the image as well as some other information possibly usefull information. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reverse plural forms to singular for search
I was looking into that a month or so ago. Here's an article that mentions the Porter Stemming Algorithm http://www.scit.wlv.ac.uk/seed/docs/mypapers/stemalg.html and the official home http://www.tartarus.org/~martin/PorterStemmer/ I don't know if this is of interest. -Brian Anderson - Original Message - From: Mark Rees [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Friday, April 15, 2005 3:14 AM Subject: FW: [PHP] Reverse plural forms to singular for search Eugene, your reply-to address is set -Original Message- From: Mark Rees Sent: 15 April 2005 09:08 To: 'Eugene Voznesensky' Subject: RE: [PHP] Reverse plural forms to singular for search That sounds like a nightmare! Assuming you are talking about English, you might be able to make some progress by removing trailing s or es for words. This would trim words down to their stem. You could do this with a regular expression, which will need to do something like look for es or s with no preceding s at the end of words (to avoid trimming words like glass). It will not catch forms like medium/media and thesis/theses. You could think about trying to trim words like that down to their stem (med in this case). In fact, would just trimming off the last two letters and searching for that do for you? It depends on the range of words you are searching for. Good luck Mark -Original Message- From: Eugene Voznesensky [mailto:[EMAIL PROTECTED] Sent: 14 April 2005 17:22 To: php-general@lists.php.net Subject: [PHP] Reverse plural forms to singular for search I'm trying to reverse plural forms to singular ones and use the result for search [in database]. Is there any third party product to integrate with PHP, or some reliable algorithm? Thank you, Eu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Gamma Global : Suppliers of IBM, Compaq, Cisco, Sun Microsystems, 3Com and HP Products. GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 2000' REGISTERED COMPANY ** CONFIDENTIALITY NOTICE: This Email is confidential and may also be privileged. If you are not the intended recipient, please notify the sender IMMEDIATELY; you should not copy the email or use it for any purpose or disclose its contents to any other person. GENERAL STATEMENT: Any statements made, or intentions expressed in cessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content herein may be held binding upon Gamma Global (UK) Ltd or any associated company unless confirmed by the issuance of a formal contractual document or Purchase Order, subject to our Terms and Conditions available from http://www.gammaglobal.com EOE ** ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: A question
On 4/16/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 16 Apr 2005 Khorosh Irani wrote: How I can find it in phpinfo() ? Another (simpler) approach is: not as versitile though. php_sapi_name() is better suited to situations where you will do something differently depending on the sapi used. An example of this would be form authentication when using CGI, and HTTP Authentication when using Apache. echo php_sapi_name(); which will return 'cli', 'cgi', etc. -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: trying to send mail via localhost
I'm not expert, on this area, but unless I'm mistaken, that happens when the email address you are sending the mail to doesn't exist. For example if you try to send a mail to [EMAIL PROTECTED], when the actual address is [EMAIL PROTECTED], the username monk will not exist. Check your 'to' address. On 4/16/05, Satyam [EMAIL PROTECTED] wrote: I think the specs are in RFC 822. You should find if there. Satyam AndreaD [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] When trying to send mail via localhost I get the following error Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Any ideas?/ RH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: trying to send mail via localhost
Hi, Unless I'm mistaken, it's cause of bad SMTP address in your php.ini file, and so (if you haven't installed SMTP server on your PC), you have to set the SMTP line in your php.ini file to your internet provider's smtp address. For example, I'm on Windows and my internet provider's smtp address is mx.e-teliamtc.lv, so php.ini file looks like: [mail function] ; For Win32 only. SMTP = mx.e-telia.lv ; For Unix only. You may supply arguments as well (default: sendmail -t -i). ;sendmail_path = Sorry for my bad english, Lab -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Streaming video BLOBs from MySQL
Hmmm... not sure how this is done. I see someone added an example that they use substring to load 10mb of data at a time from the blob. The part I don't understand is how they loop the statements and continue to stream data to the user. If I make one pass and get 1mb of the blob...the browser is simply going to load that 1mb only, right? How do I keep looping and refreshing the users browser, or in this case, flash player? Thanks for any ideas! --- Marek Kilimajer [EMAIL PROTECTED] wrote: J J wrote: I have a case where video files (mov, flv, etc) have been stored in a MySQL database as blobs. I'm loading them into a flash video player and everything works fine except it takes longer it seems and it doesn't allow streaming the actual video. If I load the same videos with a direct link to the http:// file system (/videos/file.flv) it loads in super-fast and allows streaming. I'm guessing mysql and/or php doesn't actually release the BLOB until it's loaded it completely. So, is there a way to actually have PHP read the BLOB and stream it as it's loading? Is there an fstream() option like the fread()? use mysql's SUBSTRING() function in a loop __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Streaming video BLOBs from MySQL
If I make one pass and get 1mb of the blob...the browser is simply going to load that 1mb only, right? How do I keep looping and refreshing the users browser, or in this case, flash player? Thanks for any ideas! Look into flush(); thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parse Error on mysql_query
Hi, I'm beginning to learn PHP/MySQL, i have problem 'parse error' when using 'mysql_query' although it was simple code, like this : = 1 ?php 2 $host = localhost; 3 $user = root; 4 $pass = alpha; 5 $konek = mysql_connect($host,$user,$pass); 6 if (!$konek) { 7 die ('failed'.mysql_error()); 8 } 9 echo 'Connect'; 10 $dbname = testdb; 11 12 $db = mysql_select_db ($dbname,$konek); 13 if (!$db) { 14 die ('not connect'.mysql_error()); 15 } 16 echo 'ok' 17 $query = mysql_query(select * from clients,$konek); 18 ? == Parse error: parse error, expecting `','' or `';'' in d:\www\test\refer1.php on line 17 Can anyone help me to explain this problem Thanks in advance
Re: [PHP] Parse Error on mysql_query
Add a ; to the end of line 16. On Sun, 17 Apr 2005, Bagus Nugroho wrote: Hi, I'm beginning to learn PHP/MySQL, i have problem 'parse error' when using 'mysql_query' although it was simple code, like this : = 1 ?php 2 $host = localhost; 3 $user = root; 4 $pass = alpha; 5 $konek = mysql_connect($host,$user,$pass); 6 if (!$konek) { 7 die ('failed'.mysql_error()); 8 } 9 echo 'Connect'; 10 $dbname = testdb; 11 12 $db = mysql_select_db ($dbname,$konek); 13 if (!$db) { 14 die ('not connect'.mysql_error()); 15 } 16 echo 'ok' 17 $query = mysql_query(select * from clients,$konek); 18 ? == Parse error: parse error, expecting `','' or `';'' in d:\www\test\refer1.php on line 17 Can anyone help me to explain this problem Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session variables are not stored when set in implicitly called constructor!??
Hallo everybody, hope I am writing to correct mailinglist(^_^*)... I have troubles with sessions and descructor in php5. Can not set session variable in destructor when it's called implicitly. Do You know solution please? I think problem is that session is stored before imlicit object destruction *doh* example.php: ?php session_start(); session_register(variable); // singleton for request class Request { function __destructor() { $_SESSION[variable] = hallo; } } $req = Request::getInstance(); $req-doSomeThink(); echo This should be hallo 2nd time: . $_SESSION[variable];// unfortunatly this is not set echo a href='example.php'Click and cry;-(/a; // implicit desturctor call ? Thank You very much... BR a3c -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Another array sorting Problem
Hi, I have a multidimensional array looking linke this Rowid title kat 123 nr1 3 442 nr2 2 547665 nr3 5 4532nr4 3 3244nr5 1 124 nr6 2 776 nr7 4 I now need to sort that array first by kat and second on rowid, so it would throw out: Nr5 Nr6 Nr2 Nr1 Nr4 Nr7 Nr3 I tried to achieve that goal with array_multiosort(), but all I got was a one way (either rowid or kat) sorting. Do you know some kind of way to achieve my goal? Thabk you for helping. Mirco Blitz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Another array sorting Problem
Hi, I have a multidimensional array looking linke this Rowid title kat 123 nr1 3 442 nr2 2 547665 nr3 5 [snip] I now need to sort that array first by kat and second on rowid, so it would throw out: Nr5 Nr6 Nr2 [snip] I tried to achieve that goal with array_multiosort(), but all I got was a one way (either rowid or kat) sorting. Do you know some kind of way to achieve my goal? Take a look at usort()... http://us4.php.net/usort There's an example for multi-dimensional arrays... -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Streaming video BLOBs from MySQL
On 4/17/2005 2:08:43 AM, Chris Boget ([EMAIL PROTECTED]) wrote: If I make one pass and get 1mb of the blob...the browser is simply going to load that 1mb only, right? How do I keep looping and refreshing the users browser, or in this case, flash player? Thanks for any ideas! Look into flush(); yeah... you gotto ...or it starts to pile up after a few days :-) -Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 4/16/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php