Re: [PHP] showing any mysql query in a table, help!

2006-03-18 Thread Jim Lucas
[EMAIL PROTECTED] wrote: Ok... it has to be a way to do such a thing. I do i get the column names? I can get the number of columns using mysql_num_fields() right? but what if i want to get the columns name? Wich functtion and how should i use? the goal is to make a function that prints a table t

Re: [PHP] showing any mysql query in a table, help!

2006-03-18 Thread Chris
You could fetch the rows in an associate array. Then loop over each element in the array printing it out inside tags.. print out before the columns, after. To get the header just loop through the keys of the associative array. Whenever you want to show the header. Unless I'm misunderstand

[PHP] showing any mysql query in a table, help!

2006-03-18 Thread pgaio
Ok... it has to be a way to do such a thing. I do i get the column names? I can get the number of columns using mysql_num_fields() right? but what if i want to get the columns name? Wich functtion and how should i use? the goal is to make a function that prints a table that prints the result of a

Re: [PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Greg Beaver
Manuel Amador (Rudd-O) wrote: > Just for argument's sake: the result is not identical. Assume, for > one second, that you have two PHP functions: > > function getCitiesAsHTML($countryName); > function getCitiesAsXML($countryName); > > The first issues a snippet of HTML text, with s. The second >

[PHP] Merging two partially-transparent images results in black pixels

2006-03-18 Thread Jason Young
Hello, I have an image that uses partial transparency for borders and such. At first, I tried using the whole image; creating a truecolor 'holder' image, then imagecopymerge-ing it, but that resulted in the outside transparent areas (the ones that would instead show the 'holder' image) were bl

Re: [PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Manuel Amador (Rudd-O)
Greg Beaver wrote: This is obvious: you need only test the output of the PHP server class, All the more reasons to use a serialization markup language instead of just plain HTML. Testing for specific HTML output may break if the HTML output changes, but not if you're using XML or JSON, be

Re: [PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Greg Beaver
Manuel Amador (Rudd-O) wrote: > >> 1) what if the returned markup is invalid? >> >> Well, the browser renders it oddly, and through the fact that your >> server-side code is straightforward filling in an html template with >> actual values, all you need to do is view the source (with the firefox >

RE: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Chrome
ch box -- is that what > you're looking for? > > tedd > -- > -- > -- > http://sperling.com > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ NOD32 1.1450 (20060318) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] no newline after "?>" in the resulting HTML

2006-03-18 Thread Rasmus Lerdorf
Rostislav Krasny wrote: On Sat, 18 Mar 2006 13:49:19 -0800 [EMAIL PROTECTED] (Jim Lucas) wrote: put a space after the ?> and you will retain the line feed It also adds that space before the retained line feed, but so it looks better anyway. Excellent suggestion, thank you! Could it be added t

RE: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread tedd
No. All of the examples I find are like the 'google' style suggest-thingy. I want to dynamically (AJAX) populate an actual: foo bar fee fum Basically the core problem is passing back an 'array' of data from mysql into JS to make the box. What I've 'hacked'

RE: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Daevid Vincent
No. All of the examples I find are like the 'google' style suggest-thingy. I want to dynamically (AJAX) populate an actual: foo bar fee fum Basically the core problem is passing back an 'array' of data from mysql into JS to make the box. What I've 'hacked

[PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Manuel Lemos
Hello, on 03/17/2006 11:42 PM Daevid Vincent said the following: > I need to dynamically update a select box > with results from a SQL database using AJAX, > but I can't find a single example of how to do this. > > Basically I have a text input field, and a select box. > As someone types in th

Re: [PHP] no newline after "?>" in the resulting HTML

2006-03-18 Thread Rostislav Krasny
On Sat, 18 Mar 2006 13:49:19 -0800 [EMAIL PROTECTED] (Jim Lucas) wrote: > put a space after the ?> and you will retain the line feed It also adds that space before the retained line feed, but so it looks better anyway. Excellent suggestion, thank you! Could it be added to the FAQ and to the offic

Re: [PHP] no newline after "?>" in the resulting HTML

2006-03-18 Thread Jim Lucas
Rostislav Krasny wrote: Hi, I've tried to ask the following question on internals@lists.php.net but has been pointed out that that mailing list isn't appropriate. So I'm resinding it here. I am a newbie to PHP. I've installed a php5-cgi-5.1.2_1 from FreeBSD ports collection and access it by Fas

[PHP] Re: no newline after "?>" in the resulting HTML

2006-03-18 Thread Rostislav Krasny
On Sat, 18 Mar 2006 19:37:48 + [EMAIL PROTECTED] (James Benson) wrote: > I get the same results, I doubt it's a bug, the person who wrote the > article maybe never tried what it would output since they probably know > how the echo construct works, I think it is a bug. That part of the artic

Re: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread tedd
I need to dynamically update a select box with results from a SQL database using AJAX, but I can't find a single example of how to do this. Basically I have a text input field, and a select box. As someone types in the input field, I want the select box to fill in the results of matches. I can f

Re: [PHP] Updating a single line in a file

2006-03-18 Thread Manuel Amador (Rudd-O)
Replies inlined. Why dont you use a database for this? You will run into race conditions at some point. If you need a file based database take a look at sqlite. Curt. -- About the race conditions, I didn't mentionned I had some extras code to care about concurrent writing on the file Ab

Re: [PHP] Updating a single line in a file

2006-03-18 Thread smr78
"Curt Zirzow" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > On Sat, Mar 18, 2006 at 11:01:07AM +0100, smr78 wrote: >> Hi, >> What is the best method to update a single line in a text file? >> I have a file made of identifiers, that is pointed on by a htaccess file >> a

Re: [PHP] no newline after "?>" in the resulting HTML

2006-03-18 Thread Chris Shiflett
Rostislav Krasny wrote: Why there is no newline afer "Hello World"? Is it a PHP bug or the tutorial should be updated? I discuss this here: http://shiflett.org/archive/151 It's a feature of PHP that has some advantages and disadvantages, and it's not likely to change (consistency has merit, r

[PHP] Re: no newline after "?>" in the resulting HTML

2006-03-18 Thread James Benson
Rostislav Krasny wrote: Hi, I've tried to ask the following question on internals@lists.php.net but has been pointed out that that mailing list isn't appropriate. So I'm resinding it here. I am a newbie to PHP. I've installed a php5-cgi-5.1.2_1 from FreeBSD ports collection and access it by F

Re: [PHP] no newline after "?>" in the resulting HTML

2006-03-18 Thread Rasmus Lerdorf
Adrian wrote: Is there a way to circumvent this? My template engine compiles templates to PHP files and this "feature" makes the output html code look awful sometimes. Nope. Put in an extra newline after ?> if you need them, or put a \n at the end of the last echo inside the PHP block. -Ras

Re: [PHP] no newline after "?>" in the resulting HTML

2006-03-18 Thread Adrian
Is there a way to circumvent this? My template engine compiles templates to PHP files and this "feature" makes the output html code look awful sometimes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] no newline after "?>" in the resulting HTML

2006-03-18 Thread Rasmus Lerdorf
Brady Mitchell wrote: Why there is no newline afer " Hello World" ? Is it a PHP bug or the tutorial should be updated? The tutorial is fine. The sample code mentioned: PHP Test Hello World'; ?> Contains a line break after the Hello World is echoed . Check your code, if you do

RE: [PHP] no newline after "?>" in the resulting HTML

2006-03-18 Thread Brady Mitchell
> Why there is no newline afer " Hello World" ? > Is it a PHP bug or the tutorial should be updated? The tutorial is fine. The sample code mentioned: PHP Test Hello World'; ?> Contains a line break after the Hello World is echoed . Check your code, if you don't have that line bre

Re: [PHP] Updating a single line in a file

2006-03-18 Thread Curt Zirzow
On Sat, Mar 18, 2006 at 11:01:07AM +0100, smr78 wrote: > Hi, > What is the best method to update a single line in a text file? > I have a file made of identifiers, that is pointed on by a htaccess file and > used by a server to give access to a web site. > The file content is like this : > login1:

[PHP] no newline after "?>" in the resulting HTML

2006-03-18 Thread Rostislav Krasny
Hi, I've tried to ask the following question on internals@lists.php.net but has been pointed out that that mailing list isn't appropriate. So I'm resinding it here. I am a newbie to PHP. I've installed a php5-cgi-5.1.2_1 from FreeBSD ports collection and access it by FastCGI protocol from nginx H

Re: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread dave
hi, i used http://www.ajaxfreaks.com/tutorials/6/3.php?topic_id=73&hl=104#104 it works just fine, i implemented to one of my web, so far so good. Hope it's what u are looking for Daevid Vincent wrote: > I need to dynamically update a select box > with results from a SQL database using AJAX, > bu

Re: [PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Manuel Amador (Rudd-O)
1) what if the returned markup is invalid? Well, the browser renders it oddly, and through the fact that your server-side code is straightforward filling in an html template with actual values, all you need to do is view the source (with the firefox web debugging extension you can view generate

Re: [PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Greg Beaver
Manuel Amador (Rudd-O) wrote: > Greg Beaver wrote: > >> This is far too complicated. You don't need 50 lines of code to convert >> from server-side data to HTML when the browser does it for you (and far >> more efficiently) with this code: >> >> var someCallback = { >>ajaxfunc: function(res)

Re: [PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Manuel Amador (Rudd-O)
Greg Beaver wrote: This is far too complicated. You don't need 50 lines of code to convert from server-side data to HTML when the browser does it for you (and far more efficiently) with this code: var someCallback = { ajaxfunc: function(res) { document.getElementById('blah').innerHTML

Re: [PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Greg Beaver
Manuel Amador (Rudd-O) wrote: > Greg Beaver wrote: > >> Daevid Vincent wrote: >> >> >>> I need to dynamically update a select box with results from a SQL >>> database using AJAX, but I can't find a single example of how to do >>> this. >>> >>> Basically I have a text input field, and a select bo

Re: [PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Manuel Amador (Rudd-O)
Greg Beaver wrote: Daevid Vincent wrote: I need to dynamically update a select box with results from a SQL database using AJAX, but I can't find a single example of how to do this. Basically I have a text input field, and a select box. As someone types in the input field, I want the sel

[PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Greg Beaver
Daevid Vincent wrote: > I need to dynamically update a select box > with results from a SQL database using AJAX, > but I can't find a single example of how to do this. > > Basically I have a text input field, and a select box. > As someone types in the input field, > I want the select box to f

[PHP] Multiple inheritance: a technique

2006-03-18 Thread Manuel Amador (Rudd-O)
Hello, everyone. I'm (by nature) a Python coder, and (by fiat) a PHP one. Yes, I code in Python for fun, and PHP for work. Despite that, I'm extremely thankful for the efforts poured into PHP. It's a great language. Except for one thing. It lacks multiple inheritance. But PHP 5 has the r

[PHP] Updating a single line in a file

2006-03-18 Thread smr78
Hi, What is the best method to update a single line in a text file? I have a file made of identifiers, that is pointed on by a htaccess file and used by a server to give access to a web site. The file content is like this : login1:pass1\r\n login2:pass2\r\n loginn:passn\r\n loginn1:passn1\r\n

RE: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Weber Sites LTD
Why invent the wheel? http://developer.ebusiness-apps.com/technologies/webdevelopment/codeandcompo nents/ebawebcombov3/default.htm Sincerely berber Visit the Weber Sites Today, To see where PHP might take you tomorrow. PHP code examples : http://www.weberdev.com PHP & MySQL Forums : http

[PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread David Dorward
Daevid Vincent wrote: > I need to dynamically update a select box > with results from a SQL database using AJAX, > but I can't find a single example of how to do this. Break it down in to stages. 1. Make the request to the server 2. Have the PHP gather the data from the database 3. Return the da