[PHP-DB] More on strings
I thought I had it but I didn't! I can only get LIKE to perform queries that allow me use the result for a subsequent query but for accuracy, I need to use actual values. The first statement below works OK (at least I get a Resource id #) - courtesy of help received here - but will not return $pcodeid from the third statement - it dies giving me "No pcodeid". Using the LIKE version (second one below) works fine and I can use the $pcodeid array elements as I like. Any thoughts gratefully received. $resultp = mysql_query("select Primaryid from primarycodes where Code = '".$row['Primaryexpertise']."'") or die (mysql_error()); $resultp = mysql_query("select Primaryid from primarycodes where Code like '%$row[Primaryexpertise]%'") or die (mysql_error()); $pcodeid = mysql_fetch_array($resultp) or die("No pcodeid"); Regards Mick Lloyd [EMAIL PROTECTED] Tel: +44 (0)1684 560224 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] MySQL errors on win32
Hi all, I just installed apache, php mysql on a win98 laptop. I normally use linux Things work fine, but when I execute more queries in one script, I get error messages like: Warning: MySQL: Unable to save result set in c:/program files/apache group/apache/htdocs/network-club.com/agenda.php4 on line 14 I saw something in the FAQ about this, but that was when upgrading. I use Win98 SE UK, Apache 1.3.14, php 4.0.4pl1, Mysql 3.23.22-beta. TIA, Dirk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] No. of Users online right now?
Hi there, This is a NewBie Question: While out surfing I have often seen a message like: "There are 17 users on this site at the moment." Can I do this with php? Just to show how many people are on (browsing) the site at that moment? I run a community website. Thanks == Regards from Denmark, Europe Please cc your reply to [EMAIL PROTECTED] == I haven't lost my mind, I've got it backed up on TAPE somewhere... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Expires Pages
Hello, I'd like the user of my site to log in/out, but, how can I disallow the user to press the 'back button' of the browse after logout, and back to the page ??? What I need: - The user press 'logout'; if (user press the 'back button' of the browser) then show a page telling that the page expired just when the user clicked at logout. fi I was reading about cookies, I think I have to go in this direction, but, how ??? Thanks in advance, See ya. Marcelo Pereira Campinas' University - Brazil
RE: [PHP-DB] Expires Pages
this should work ... in the top of the page, before any other headers are sent ?php header ("Ex-pires:Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // al-ways modified header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 ? -Original Message- From: Marcelo Pereira [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 12:32 To: [EMAIL PROTECTED] Subject: [PHP-DB] Expires Pages Hello, I'd like the user of my site to log in/out, but, how can I disallow the user to press the 'back button' of the browse after logout, and back to the page ??? What I need: - The user press 'logout'; if (user press the 'back button' of the browser) then show a page telling that the page expired just when the user clicked at logout. fi I was reading about cookies, I think I have to go in this direction, but, how ??? Thanks in advance, See ya. Marcelo Pereira Campinas' University - Brazil -- 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] problems configuring php and postgres - call to undefined function
get the postgrtesql source code and untar then run ./configure etc etc on postgresql then run ./configure in php as ./configure --with-pgsql=/path/to/untarred/source/files e.g. postgresql source untarred to /usr/src/postgresql php configure options are: ./configure --with-pgsql=/usr/src/postgresql/ and not /usr/local/pgsql php needs to see the source code not the install dir. Steve -Original Message- From: Gary Huntress [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 12:39 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] problems configuring php and postgres - "call to undefined function" I just added phpinfo() to my test page and the "configure command" section does NOT include --with-pgsqlclearly that is my problem I just deleted my php-4.0.4 source directory and reinstalled the tarball, ran ./configure --with-pgsql=/usr/local/pgsql --with-xml ; make ; make install, received no errors and still have the same error. There is *something* that I'm not cleaning up properly.. Regards, Gary "Rasmus Lerdorf" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What kind of binary install did you do? An rpm? If so, simply also install the rpm-devel package and it will compile nicely. -Rasmus On Tue, 20 Mar 2001, Gary Huntress wrote: I am trying to get postgresql (pg) support for php working on my RH7 box. I had a working binary installation of postgres 7.03. I thought I had read that php4 had default support for pg, but my call to pg_connect() gave me a "Call to undefined function" error. So, next I tried to re ./configure and add --with-pgsql=/usr/local/pgsql. That would not compile, bombing when it looked for "postgres.h". I did not have the pg source (since this was a binary installation) so I installed that next (in /usr/src, if that matters) I deleted my existing binary installation of pg, and ran ./configure; gmake; gmake install with no errors, and I added an entry in /etc/ld.so.conf as stated in the pg INSTALL. Pg is running fine with several db and I can remotely connect, so I think thats ok. After finishing with the source installation of pg, I re- ./configure php, make and get the same error looking for "postgres.h" kludge I then manually edited the ./configure file and added the include path to /usr/src/postgres/install/kludge After this, I could successfully make php, then make install. I restarted apache, but I am still getting "Call to undefined function". Any thoughts? I'm pretty much out of ideas right now. Regards, Gary Huntress -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] LO on postgreSQL HELP!
Hallo! I'm trying to read lo objects (images) from postgreSQL using php's pg_loreadall() function with the intention of put them dirctly on a html document, but I can't. I also have problems about how to embed the result of the pg_loread() on a html document. Somebody can help me? Thak you very much! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] mysql_result
I'm trying to use mysql_result to extract data from one particular field in a record. So I suppose the most viable solution is to use mysql_result. But when I do this: $sqlstmt="SELECT * FROM dept WHERE shortname=$shortname"; $result=mysql_query($sqlstmt); $temp=mysql_result($result,0,"shortname"); -- This will give me an error Did I do anything wrong here? Thanks in advance. Shahmat -- 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] More on strings
$resultp = mysql_query("select Primaryid from primarycodes where Code = '".$row['Primaryexpertise']."'") or die (mysql_error()); $resultp = mysql_query("select Primaryid from primarycodes where Code like '%$row[Primaryexpertise]%'") or die (mysql_error()); $pcodeid = mysql_fetch_array($resultp) or die("No pcodeid"); Two suggestions.: First, stick the query into a variable instead of using it directly; that way you can do some simple debugging (i.e. print the query to the page instead of posting this email). Second, take the array variable out of the double quotes, like you did in the first line. $sql = "select Primaryid from primarycodes where Code like'%" . $row[Primaryexpertise] . "%'"; print $sql . "BR\n"; $resultp = mysql_query($sql) or die (mysql_error()); - Darryl -- Darryl Friesen, B.Sc., Programmer/Analyst[EMAIL PROTECTED] Education Research Technology Services, http://gollum.usask.ca/ Department of Computing Services, University of Saskatchewan -- "Go not to the Elves for counsel, for they will say both no and yes" -- 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] Select where
On Wed, 21 Mar 2001, boclair wrote: This is simple but I cannot see where I am going wrong I have a table members with one of the fields status, varchar(10) The values may be active or retired or deceased or null If I run the select SELECT * FROM members WHERE status = 'deceased'; I getMySQL said: You have an error in your SQL syntax near '\'deceased\';' at line 1 Will somebody show me the correct syntax Tim Morris you need to pass the quotes to mysql, hence you have to backslash them in the php code. Try : $query="SELECT * FROM members WHERE status = \"deceased\""; -- Ben History is curious stuff You'd think by now we had enough Yet the fact remains I fear They make more of it every year. -- 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] How do I test on number of fields ?
On Mon, Mar 19, 2001 at 10:06:52PM -0800, Toke Herkild wrote: I've written this login rutine But that doesn't work... I've tried to use mysql_num_rows too but I still get : bWarning/b: Supplied argument is not a valid MySQL result resource in bg://web/herkild/html/loginout.php/b on line b113/bbr if ($ACTION == 'Login') { $query = "SELECT user.ID FROM user WHERE "; $query .= "user.brugerID = $LoginBrugerID AND "; $query .= "user.kodeord = $LoginKodeord;"; $mysql_result = mysql_query($query, $mysql_link); (line 113 ) if ($row = mysql_fetch_row($mysql_result)){ setcookie("Herkild_Domain", $row[0]); Logged_in(); } else { wronguser(); } } It looks like you might be missing some quotes in your query. After you call mysql_query(), call mysql_error($mysql_link); It will show you your error in your query. -- Jason Stechschulte [EMAIL PROTECTED] -- There are still some other things to do, so don't think if I didn't fix your favorite bug that your bug report is in the bit bucket. (It may be, but don't think it. :-) Larry Wall in [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] Select where
- Original Message - From: boclair [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 21, 2001 12:02 AM Subject: [PHP-DB] Select where This is simple but I cannot see where I am going wrong I have a table members with one of the fields status, varchar(10) The values may be active or retired or deceased or null If I run the select SELECT * FROM members WHERE status = 'deceased'; I getMySQL said: You have an error in your SQL syntax near '\'deceased\';' at line 1 Will somebody show me the correct syntax ___ $query = "SELECT * FROM members where status='deceased'" Then just call the $query in your script ___ Thanks, I only gave the mySQL but the php scripting is $deceased = mysql_query(SELECT * FROM members where status=\'deceased\'"); and later while ($myrow = mysql_fetch_row($deceased)) MySQL now says in relation to the *while* line Warning: Supplied argument is not a valid MySQL result resource Tim Morris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mysql_result
I've tried what you suggested and it works, thanks. Russ Michell wrote: Try: $sqlstmt="SELECT * FROM dept WHERE shortname='$shortname'"; //Include single quotes.. Russ #---# "Believe nothing - consider everything" Russ Michell Anglia Polytechnic University Webteam http://gertrude.sipu.anglia.ac.uk/webteam [EMAIL PROTECTED] +44 (0)1223 363271 ext 2331 www.theruss.com #---# -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mysql_result
That didn't quite work, I tried using single quote enclose within double quotes and it works. $sqlstmt="SELECT * FROM dept WHERE shortname='$shortname'"; Thanks anyway ben wrote: On Tue, 20 Mar 2001, Shahmat Dahlan wrote: I'm trying to use mysql_result to extract data from one particular field in a record. So I suppose the most viable solution is to use mysql_result. But when I do this: $sqlstmt="SELECT * FROM dept WHERE shortname=$shortname"; $result=mysql_query($sqlstmt); $temp=mysql_result($result,0,"shortname"); -- This will give me an error Did I do anything wrong here? Thanks in advance. Shahmat The problem is that the query is wrong. Try $sqlstmt="SELECT * FROM dept WHERE shortname=\"$shortname\""; (you need to send quotes to mysql if the type of shortname in your database is text or the like, that's why there's the \"$var\") -- Ben History is curious stuff You'd think by now we had enough Yet the fact remains I fear They make more of it every year. -- 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] Select where
Thanks, I only gave the mySQL but the php scripting is $deceased = mysql_query(SELECT * FROM members where status=\'deceased\'"); and later while ($myrow = mysql_fetch_row($deceased)) MySQL now says in relation to the *while* line Warning: Supplied argument is not a valid MySQL result resource Yikes! I hope those are typos, and that you didn't cut and paste that query from your script. If you did, then it needs some work. Try: $deceased = mysql_query("SELECT * FROM members where status='deceased'"); You need the leading double quote before SELECT, and you don't need to escape the single quotes. - Darryl -- Darryl Friesen, B.Sc., Programmer/Analyst[EMAIL PROTECTED] Education Research Technology Services, http://gollum.usask.ca/ Department of Computing Services, University of Saskatchewan -- "Go not to the Elves for counsel, for they will say both no and yes" -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Dynamically build a form from mySQL table
Hi, I've been trying to figure this out by looking through the code in phpMyAdmin but I'm not getting very far. What I want to do is dynamically generate a form where I get a table row containing the field name in one cell and the input field in the next cell, for example: $DatabaseName = "FocusDynamics"; $TableName = "Items"; // open the table and get all field names, sizes, etc., // for each Field name, print something like: PRINT "tr\n"; PRINT "td$FieldName/td\n"; PRINT "tdinput type=\"text\" name=\"$FieldName\" value=\"$FieldValue\" maxlength=\"FieldSize\"/td\n"; PRINT "/tr"; How do I get all this info from the table? Thanks for any help. Martin E. Koss M: 07946-706459 E: [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] problems configuring php and postgres - call to und efined function
--with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql. Set DIR to shared to build as a dl, or shared,DIR to build as a dl and still specify DIR. this did not work when i compiled. pointing at the source did. i tried pointing php at both dirs to no avail. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 16:09 To: Steve Brett Subject: RE: [PHP-DB] problems configuring php and postgres - "call to und efined function" Well, you just didn't point PHP at the right place then. On Tue, 20 Mar 2001, Steve Brett wrote: it wouldn't compile without it. really. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 15:46 To: Steve Brett Subject: RE: [PHP-DB] problems configuring php and postgres - "call to und efined function" Well, that's not true. If you install from source it will install the libpq.a and the postgres.h files. You should never point PHP at the raw source directory. -Rasmus On Tue, 20 Mar 2001, Steve Brett wrote: just an add-on. if you compile form source the --with-pgsql= needs to point to the source directory in order to find the files it needs. it does say in the php configure help option that it should point to the install dir i think whihc is a bit confusing as i learnt to my peril (and boredom) Steve -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 08:03 To: Gary Huntress Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] problems configuring php and postgres - "call to undefined function" What kind of binary install did you do? An rpm? If so, simply also install the rpm-devel package and it will compile nicely. -Rasmus On Tue, 20 Mar 2001, Gary Huntress wrote: I am trying to get postgresql (pg) support for php working on my RH7 box. I had a working binary installation of postgres 7.03. I thought I had read that php4 had default support for pg, but my call to pg_connect() gave me a "Call to undefined function" error. So, next I tried to re ./configure and add --with-pgsql=/usr/local/pgsql. That would not compile, bombing when it looked for "postgres.h". I did not have the pg source (since this was a binary installation) so I installed that next (in /usr/src, if that matters) I deleted my existing binary installation of pg, and ran ./configure; gmake; gmake install with no errors, and I added an entry in /etc/ld.so.conf as stated in the pg INSTALL. Pg is running fine with several db and I can remotely connect, so I think thats ok. After finishing with the source installation of pg, I re- ./configure php, make and get the same error looking for "postgres.h" kludge I then manually edited the ./configure file and added the include path to /usr/src/postgres/install/kludge After this, I could successfully make php, then make install. I restarted apache, but I am still getting "Call to undefined function". Any thoughts? I'm pretty much out of ideas right now. Regards, Gary Huntress -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] getmxrr() timed out
Hi all Such problem - I cant get MX records from my php script When I use getmxrr() function it times out. But such functions as gethostbyname() work. Anybody knows the problem? Thanks, Vlad
RE: [PHP-DB] problems configuring php and postgres - call to und efined function
But did you have /usr/local/pgsql/include and /usr/local/pgsql/lib directories with the correct files in them? On Tue, 20 Mar 2001, Steve Brett wrote: --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql. Set DIR to shared to build as a dl, or shared,DIR to build as a dl and still specify DIR. this did not work when i compiled. pointing at the source did. i tried pointing php at both dirs to no avail. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 16:09 To: Steve Brett Subject: RE: [PHP-DB] problems configuring php and postgres - "call to und efined function" Well, you just didn't point PHP at the right place then. On Tue, 20 Mar 2001, Steve Brett wrote: it wouldn't compile without it. really. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 15:46 To: Steve Brett Subject: RE: [PHP-DB] problems configuring php and postgres - "call to und efined function" Well, that's not true. If you install from source it will install the libpq.a and the postgres.h files. You should never point PHP at the raw source directory. -Rasmus On Tue, 20 Mar 2001, Steve Brett wrote: just an add-on. if you compile form source the --with-pgsql= needs to point to the source directory in order to find the files it needs. it does say in the php configure help option that it should point to the install dir i think whihc is a bit confusing as i learnt to my peril (and boredom) Steve -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 08:03 To: Gary Huntress Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] problems configuring php and postgres - "call to undefined function" What kind of binary install did you do? An rpm? If so, simply also install the rpm-devel package and it will compile nicely. -Rasmus On Tue, 20 Mar 2001, Gary Huntress wrote: I am trying to get postgresql (pg) support for php working on my RH7 box. I had a working binary installation of postgres 7.03. I thought I had read that php4 had default support for pg, but my call to pg_connect() gave me a "Call to undefined function" error. So, next I tried to re ./configure and add --with-pgsql=/usr/local/pgsql. That would not compile, bombing when it looked for "postgres.h". I did not have the pg source (since this was a binary installation) so I installed that next (in /usr/src, if that matters) I deleted my existing binary installation of pg, and ran ./configure; gmake; gmake install with no errors, and I added an entry in /etc/ld.so.conf as stated in the pg INSTALL. Pg is running fine with several db and I can remotely connect, so I think thats ok. After finishing with the source installation of pg, I re- ./configure php, make and get the same error looking for "postgres.h" kludge I then manually edited the ./configure file and added the include path to /usr/src/postgres/install/kludge After this, I could successfully make php, then make install. I restarted apache, but I am still getting "Call to undefined function". Any thoughts? I'm pretty much out of ideas right now. Regards, Gary Huntress -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP 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] problems configuring php and postgres - call to und efined function
from phpinfo() './configure' '--with-mysql=no' '--with-apache=/usr/src/apache_1.3.14/' '--with-pgsql=/usr/src/postgresql-7.0.3/' '--with-xml' '--enable-track-vars' '--enable-trans-sid' '--with-gd' Steve -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 16:09 To: Steve Brett Subject: RE: [PHP-DB] problems configuring php and postgres - "call to und efined function" Well, you just didn't point PHP at the right place then. On Tue, 20 Mar 2001, Steve Brett wrote: it wouldn't compile without it. really. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 15:46 To: Steve Brett Subject: RE: [PHP-DB] problems configuring php and postgres - "call to und efined function" Well, that's not true. If you install from source it will install the libpq.a and the postgres.h files. You should never point PHP at the raw source directory. -Rasmus On Tue, 20 Mar 2001, Steve Brett wrote: just an add-on. if you compile form source the --with-pgsql= needs to point to the source directory in order to find the files it needs. it does say in the php configure help option that it should point to the install dir i think whihc is a bit confusing as i learnt to my peril (and boredom) Steve -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 08:03 To: Gary Huntress Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] problems configuring php and postgres - "call to undefined function" What kind of binary install did you do? An rpm? If so, simply also install the rpm-devel package and it will compile nicely. -Rasmus On Tue, 20 Mar 2001, Gary Huntress wrote: I am trying to get postgresql (pg) support for php working on my RH7 box. I had a working binary installation of postgres 7.03. I thought I had read that php4 had default support for pg, but my call to pg_connect() gave me a "Call to undefined function" error. So, next I tried to re ./configure and add --with-pgsql=/usr/local/pgsql. That would not compile, bombing when it looked for "postgres.h". I did not have the pg source (since this was a binary installation) so I installed that next (in /usr/src, if that matters) I deleted my existing binary installation of pg, and ran ./configure; gmake; gmake install with no errors, and I added an entry in /etc/ld.so.conf as stated in the pg INSTALL. Pg is running fine with several db and I can remotely connect, so I think thats ok. After finishing with the source installation of pg, I re- ./configure php, make and get the same error looking for "postgres.h" kludge I then manually edited the ./configure file and added the include path to /usr/src/postgres/install/kludge After this, I could successfully make php, then make install. I restarted apache, but I am still getting "Call to undefined function". Any thoughts? I'm pretty much out of ideas right now. Regards, Gary Huntress -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP 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] How to display HTML code?
Now that is cool. I wish I had noticed that one before. Would have saved a lot of odd keystrokes. -- phill ""Joe Brown"" [EMAIL PROTECTED] wrote in message 996a64$k3a$[EMAIL PROTECTED]">news:996a64$k3a$[EMAIL PROTECTED]... try: ?php echo htmlentities("A HREF=home.phpHome/A"); ? ""Osman Omar"" [EMAIL PROTECTED] wrote in message 00f901c0b0cf$c99e7da0$da604a2b@sony">news:00f901c0b0cf$c99e7da0$da604a2b@sony... Hi, Suppose I want to display HTML code eg "A HREF=home.phpHome/A" How can I do that in php? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] class method
I am really new working with classes. Some of the ideas I am getting, some I am not. I wrote this simple little class, with a connection method, and a method to loop through the data. I am not even sure if my code is write (for the loop), but I am having trouble displaying the data. My connection works fine, but my loop is jacked. Could anyone suggest or maybe correct a mistake (if you see any)? Just looking to see if I am started in the right direction, or if I have this all bass ackwards. I have no clue if this is even possible. I am looking to create a while loop for whatever query I run, and make each row equal to whatever field I put in. I have all variables defined within the scope of my class. Thanks for your help. Code : function getdata() { $this-sql = $query; $result = mysql_query($query); $fetch = "mysql_fetch_array"; while ($row = $fetch($result)) { $this-field = $row['$this-field']; } if(!$result) { $this-error = mysql_error(); return; } } ** End thanks!!! [ bryan fitch . programmer . [EMAIL PROTECTED] ]
Re: [PHP-DB] problems configuring php and postgres - FIXED
My thanks to everyone who provided me info and other hints/tips. The vast majority of the problem was human error of course, sprinkling in a few bad assumptions and some configuration problems...its amazing I got it working at allbut it is :) Thanks again to everyone. Gary "Rasmus Lerdorf" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... But did you have /usr/local/pgsql/include and /usr/local/pgsql/lib directories with the correct files in them? On Tue, 20 Mar 2001, Steve Brett wrote: --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql. Set DIR to shared to build as a dl, or shared,DIR to build as a dl and still specify DIR. this did not work when i compiled. pointing at the source did. i tried pointing php at both dirs to no avail. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Transmitting Arrays
I have a form which dynamically builds a table by taking data out of a mysql database http://www.fyrespray.net/screenshots/admin/modifyscreenshot.php4?pageid=1 but i'm having problems whn i try to modify the data i'm trying to put all the data into arrays serialize it, urlencode it then send it on to the next page to put it into database and then send back to the original page when its done, i'm having a problem actually sendig my arrays around though, the second page doesn't seem to get any data after i have unserialized it and urlunecoded it. anyone have any ideas, i've been fiddleing about a load with the code and there is a good chance i have totally messed it up now heres the state its in atm though if you would like to look http://www.fyrespray.net/screenshots/admin/modifyscreenshot.txt http://www.fyrespray.net/screenshots/admin/modify.txt (prolly need to save the first page if your browser is picking up the html bits and making half of a web page up like mine does) -- 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] class method
I need a little more information to help you. Is the $query variable a global one ? Or is it a property of the class ( var $query; ) ? Why are you assigning the "mysql_fetch_array" function to a variable if call it is easier ? You have misplaced the "if $result" statement, the right position, I think , is : function getdata() { $this-sql = $query; $result = mysql_query($query); if( $result ) { // Check if $result is valid instead of NOT valid // $fetch = "mysql_fetch_array"; while ($row = mysql_fetch_array($result)) { $this-field = $row['$this-field']; } } else $this-error = mysql_error(); return; } HTH Jayme. www.conex.com.br/jjeffman/antispam.html -Mensagem Original- De: bryan [EMAIL PROTECTED] Para: db [EMAIL PROTECTED] Enviada em: tera-feira, 20 de maro de 2001 16:21 Assunto: [PHP-DB] class method I am really new working with classes. Some of the ideas I am getting, some I am not. I wrote this simple little class, with a connection method, and a method to loop through the data. I am not even sure if my code is write (for the loop), but I am having trouble displaying the data. My connection works fine, but my loop is jacked. Could anyone suggest or maybe correct a mistake (if you see any)? Just looking to see if I am started in the right direction, or if I have this all bass ackwards. I have no clue if this is even possible. I am looking to create a while loop for whatever query I run, and make each row equal to whatever field I put in. I have all variables defined within the scope of my class. Thanks for your help. Code : function getdata() { $this-sql = $query; $result = mysql_query($query); $fetch = "mysql_fetch_array"; while ($row = $fetch($result)) { $this-field = $row['$this-field']; } if(!$result) { $this-error = mysql_error(); return; } } ** End thanks!!! [ bryan fitch . programmer . [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] Dynamically build a form from mySQL table
If you are using MySQL you can use the "mysql_list_fields" to get the fields names from a table. HTH Jayme. -Mensagem Original- De: Martin E. Koss [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 20 de maro de 2001 12:02 Assunto: [PHP-DB] Dynamically build a form from mySQL table Hi, I've been trying to figure this out by looking through the code in phpMyAdmin but I'm not getting very far. What I want to do is dynamically generate a form where I get a table row containing the field name in one cell and the input field in the next cell, for example: $DatabaseName = "FocusDynamics"; $TableName = "Items"; // open the table and get all field names, sizes, etc., // for each Field name, print something like: PRINT "tr\n"; PRINT "td$FieldName/td\n"; PRINT "tdinput type=\"text\" name=\"$FieldName\" value=\"$FieldValue\" maxlength=\"FieldSize\"/td\n"; PRINT "/tr"; How do I get all this info from the table? Thanks for any help. Martin E. Koss M: 07946-706459 E: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] No. of Users online right now?
Have a look on Sessions. You can also write to a database every time a new visitor runs into your site and check if the other are still connected. You have to create a script that tracks every movement of the visitor. It is not a simple script. As far as I know the web server doesn't give you this information . HTH. Jayme. -Mensagem Original- De: Dan Eskildsen [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 20 de maro de 2001 07:46 Assunto: [PHP-DB] No. of Users online right now? Hi there, This is a NewBie Question: While out surfing I have often seen a message like: "There are 17 users on this site at the moment." Can I do this with php? Just to show how many people are on (browsing) the site at that moment? I run a community website. Thanks == Regards from Denmark, Europe Please cc your reply to [EMAIL PROTECTED] == I haven't lost my mind, I've got it backed up on TAPE somewhere... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] class method
Yeah, the var $query is defined to the class. I did mistype the result, thanks. I was able to make this bad boy work with placing $field = $row['row_name']; // whatever the row is called. But, if that is the case, why would I need a class? I am just trying to make it so that I can use the loop for any query that needs it, and can show any row when I need it. I appreciate your help! Thanks a lot bryan - Original Message - From: "JJeffman" [EMAIL PROTECTED] To: "db" [EMAIL PROTECTED] Sent: Tuesday, March 20, 2001 1:46 PM Subject: Re: [PHP-DB] class method I need a little more information to help you. Is the $query variable a global one ? Or is it a property of the class ( var $query; ) ? Why are you assigning the "mysql_fetch_array" function to a variable if call it is easier ? You have misplaced the "if $result" statement, the right position, I think , is : function getdata() { $this-sql = $query; $result = mysql_query($query); if( $result ) { // Check if $result is valid instead of NOT valid // $fetch = "mysql_fetch_array"; while ($row = mysql_fetch_array($result)) { $this-field = $row['$this-field']; } } else $this-error = mysql_error(); return; } HTH Jayme. www.conex.com.br/jjeffman/antispam.html -Mensagem Original- De: bryan [EMAIL PROTECTED] Para: db [EMAIL PROTECTED] Enviada em: tera-feira, 20 de maro de 2001 16:21 Assunto: [PHP-DB] class method I am really new working with classes. Some of the ideas I am getting, some I am not. I wrote this simple little class, with a connection method, and a method to loop through the data. I am not even sure if my code is write (for the loop), but I am having trouble displaying the data. My connection works fine, but my loop is jacked. Could anyone suggest or maybe correct a mistake (if you see any)? Just looking to see if I am started in the right direction, or if I have this all bass ackwards. I have no clue if this is even possible. I am looking to create a while loop for whatever query I run, and make each row equal to whatever field I put in. I have all variables defined within the scope of my class. Thanks for your help. Code : function getdata() { $this-sql = $query; $result = mysql_query($query); $fetch = "mysql_fetch_array"; while ($row = $fetch($result)) { $this-field = $row['$this-field']; } if(!$result) { $this-error = mysql_error(); return; } } ** End thanks!!! [ bryan fitch . programmer . [EMAIL PROTECTED] ] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Sessions and MySQL
I am trying to implement session support with mysql. I am using session.set_save_handler but don't really have a great set of functions does anyone have some good ones? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Loading extensions
I have IIS 4 with PHP 4pl1 running on Win NT 4. I can't seem to load the (*.dll) extensions. There seem to be something wrong with the extension path. The browsercap.ini path is pointing to the right path. Can anyone help? Thanks in advance. Shahmat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] A NETWORK MARKETER?
ATTENTION: ANY SERIOUS NETWORK MARKETER TAKE A LOOK AT THE FOLLOWING OPPORTUNITY I CAME ACROSS!! IF YOU PLUG INTO THEIR PROVEN SYSTEM, THEY GUARANTEE YOU SUCCESS, AND PROVIDE YOU WITH FREE LEADS TO BUILD YOUR GROUP!! DO NOT LET THIS SLIP AWAY!! CLICK BELOW AND FIND OUT AS I DID, WHY THESE GUYS ARE THE LEADERS IN THE INDUSTRY!! http://www.geocities.com/businessupdates2000 * THIS EMAIL COMPLIES WITH ALL REGULATIONS. TO BE REMOVED WITHIN 24 Hours, SIMPLYEMAIL [EMAIL PROTECTED] FOR IMMEDIATE REMOVAL FROM ANY FUTURE EMAILS FROM OUR COMPANY. * -- 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] Loading extensions
I've posted notes on PHP Manual http://www.php.net/manual/en/install-windows.php It might help. -- Yasuo Ohgaki ""Shahmat Dahlan"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have IIS 4 with PHP 4pl1 running on Win NT 4. I can't seem to load the (*.dll) extensions. There seem to be something wrong with the extension path. The browsercap.ini path is pointing to the right path. Can anyone help? Thanks in advance. Shahmat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]