Re: [PHP-DB] display login info
Liz Bander wrote: I want to display a user's full name and user id that would be from their login action. (The login stuff is already set up.) How would I be able to grab the user id from the login? Any ideas on where to look? Thanks, Liz -- 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] To get the username of the user who logged-in use $HTTP_SERVER_VARS{"PHP_AUTH_USER"} or $HTTP_SERVER_VARS{"REMOTE_USER"}. Then you've got the username of the user. You can just look that up in your database and get the fullname etc. to show to the user. If you realy want (although I don't see why anyone would...) you can also get his password, using $HTTP_SERVER_VARS{"PHP_AUTH_PW"}. -- * RzE: *** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 *** -- 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] Auto load PHP
On Tue, Apr 03, 2001 at 09:05:57AM +0100, Galvin, Max wrote: Why not a simple if statement to check if the function worked and then include("script2.php") ? M Well... I've got three reasons for that... 1. I never use include() for redirection. It was never meant to be used for that anyway. 2. If you use include() you're only using up more memory. And I don't know 'bout you, but I always try to write as efficient as I can. 3. When you redirect someone, you want them to go to a different page don't you? Using include() they still stay on the same page. They only get a different content. So... using header() instead of include() is more efficient i.m.o. And besides that; my projects get pretty large. In that case it's smart to keep your code 'easy-to-track'. If you start including instead of redirecting it only gets more complex tracking the flow of the site. And that while include() offers no advantages. [ I.m.o. ] -- * RzE: *** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 *** -- 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] Auto load PHP
On Tue, Apr 03, 2001 at 09:48:07AM +0100, Galvin, Max wrote: Jim Ray didn't say he wanted it redirected though, he said he wanted it "called". Redirecting was brought in by someone who replied to the post. I would also use header() but if the poster is looking for a quick "plug in" solution without having to alter any output he's already made, include or require are the simplest way. Whilst overhead is important, is taking a day to rewrite a complex script worth the tiny amount of speed/memory saving he might make? M Well, okay... I've read the original msg from J.R. again and indeed, he doesn't want to redirect. My answ was mainly based on the post from D.B. [ To J.R. ] Having read the org. msg.; I don't know if you are trying to do this. Anyway... You can also create the HTML/PHP-page you want to show, and then put the update statement at the beginning. Something like the following pseudo: # Result page - Update table - HTML -- html-content - /HTML This doesn't make much of a difference with including the HTML-part though. It's just what you like more... All your choice... -- * RzE: *** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 *** -- 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] Some assistance please
Hi People, I have a sql query running an array'd result that should echo a different result depending on the result of the query. However, it successfully does one of the entries from the query, but then appears to stop. With no further results displayed. Could someone take a look at the code at the bottom of this email and see if they can determine why it is not continuing through the rest of the results. Thanks in advance - Shannon ? $roundnum = ""; $sql = "select * from results order by round"; $dbh = @mysql_connect($dbhost,$dbuser,$dbpass); $results = mysql_db_query($db,$sql,$dbh); for($i = 0; $i mysql_num_rows($results); $i++) { $array[$i] = mysql_fetch_array($results); } mysql_close($dbh); for ($i = 0; $i count($array); $i++) { if ($array[$i]["round"] != $roundnum) { $roundnum = $array[$i]["round"]; echo "trtd colspan='5'brp align='center'bfont color='#99'Round ".$roundnum."/font/b/p/td/tr"; echo "trtd width='100'p".$array[$i]["home"]."/p/tdtd width='10'p".$array[$i]["home_goals"]."/p/tdtd width='50'\n"; if ($array[$i]["home_goals"] $array[$i]["away_goals"]) { echo "pDefeated/p/td"; } elseif ($array[$i]["home_goals"] $array[$i]["away_goals"]) { echo "pDefeated by/p/td"; } elseif ($array[$i]["home_goals"] == $array[$i]["away_goals"]) { echo "pDrew/p/td"; } echo "td width='100'p".$array[$i]["away"]."/p/tdtd width='10'p".$array[$i]["away_goals"]."/p/td\n"; } } ? -- 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] array_diff usage
On Monday 02 April 2001 15:41, you wrote: -Original Message- From: Martin Skjoldebrand [mailto:[EMAIL PROTECTED]] Sent: Saturday, March 31, 2001 10:52 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] array_diff usage I'm daft. I don't understand the PHP Manual. I have two arrays: Open[0] contains 1 2 3 4 5 Closed[0] contains 1 2 Now: $test = array_diff($Open, $Closed); Given the setup you've described, I think you might actually want $test = array_diff($Open[0], $Closed[0]); OK, I'll try that. $lines = count($test); print $lines; Gives me: 1 I thought it should be 3. Seems appropriate, given the information you've provided. $Open and $Closed each have only one element (0). While: for ($counter =0; $counter = $lines -1; $counter++) { print $test[0]; } gives me "5". This, on the other hand, makes me suspect that the arrays themselves don't actually contain what you think they do. How are you assigning the values you described at the top of your message? I'm getting them from a database. Two SELECT queries one get the open tickets, one get the closed ones. $noOpened=mysql_num_rows($jobresult1); $noClosed=mysql_num_rows($jobresult2); $getlargest = strcmp($noOpened, $noClosed); switch ($getlargest) { case $getlargest 0: $counttickets = $noOpened; while($sumOpen=mysql_fetch_row($jobresult1)) { $Open = $sumOpen; // DEBUG print $Open[0] . "br"; } while($sumClosed=mysql_fetch_row($jobresult2)) { $Closed = $sumClosed; // DEBUG print "c" . $Closed[0] . "br"; } I'm going to manipulate both arrays, so I copy them to "backups" DEBUG lines produce: 1 2 3 4 5 c1 c2 HTH, Martin S. -- 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] Re: Solaris 2.6, PHP 4.0.4pl1, Solid EE 3.51
1, I'm not sure what is needed in the Solid lib directory and where I can get the files if they're not in the archive I've used to install Solid You will need library build 123 (I believe thats the number) ONLY if you're using the version 3.51 version. 2, Because there are a number of instructions for various versions of Solid and PHP I'm unsure as to whether I'll need to manually edit any of the source files to get things working. You will need to edit one file in the 4.0.4pl1 files, as far as PHP is concerned. You might consider trying the 4.0.5 RC, which already has this typo corrected. You might also be required to correct one of the solid header files, but I'm unsure if that is needed on Solaris. On linux based systems the sqlunix.h file requires changing the line: #include wcstr.h to #include wchar.h Not entirely sure if this will be required for Solaris so you may not need to worry about this. Judging from a quick view of the header, it won't be a problem for you. Ideally it'd be good if anyone has a definitive source of information, if not just a general idea of where to start would be good. The mailing list archives and cvs logs are a good source. The php documentation is fairly upto date as well. -- Dan Kalowsky "Tonight I think I'll walk alone, Worldgate Communications I'll find my soul as I go home." Software Engineer - TICS Group - Temptation -- 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] Validating forms
It is much more efficient to do that type of validation client-side, using Javascript. No sense in making another round trip to the server if not necessary. True.. but this only works if your visitor has javascript enabled.. the biggest avantage in serverside scripting IMHO is you can forse things to happen.. Besides, a visitor with a rather old browser might get bombed with javascript errors.. An if .. then loop will do the same but.. serverside. Bye, B. -- 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 limit a WHILE statement?
Yes, LIMIT will do the job, but to answer your question: $x = 0; while ( ( $myrow = mysql_fetch_array( $result ) ) and ( ++$x 20 ) ) { [...] } Greetinx, Mike Michael Rudel - Web-Development, Systemadministration - ___ Suchtreffer AG Bleicherstrae 20 D-78467 Konstanz Germany fon: +49-(0)7531-89207-17 fax: +49-(0)7531-89207-13 e-mail: mailto:[EMAIL PROTECTED] internet: http://www.suchtreffer.de ___ -Original Message- From: Bob Stone [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 03, 2001 12:53 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] How to limit a WHILE statement? Dear PHP Helpers, What is your recommendation on limiting a while statement so that it only iterates a maximum of 20 times? Here is the code snippet: $result = mysql_query($sql, $db); while ($myrow = mysql_fetch_array($result)) { printf("Name: bfont color=\"green\" size=\"5s\"%s %s %s %s\nbr/b/font", $myrow["salutation"], $myrow["first_name"], $myrow["mid_name"], $myrow["user_name"]); Best regards, Bob Stone __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text -- 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] Auto load PHP
?php // Redirects to another Page using HTTP-META Tag function redirect( $url, $message = "", $delay = 0 ) { /* redirects to a new URL using meta tags */ echo "meta http-equiv='Refresh' content='".$delay."; url=".$url."'"; if ( !empty( $message ) ) die( "div style='font-family: Arial, Sans-serif; font-size: 12pt;' align=center ".$message." /div" ); } ? Greetinx, Mike Michael Rudel - Web-Development, Systemadministration - ___ Suchtreffer AG Bleicherstrae 20 D-78467 Konstanz Germany fon: +49-(0)7531-89207-17 fax: +49-(0)7531-89207-13 e-mail: mailto:[EMAIL PROTECTED] internet: http://www.suchtreffer.de ___ -Original Message- From: Renze Munnik [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 03, 2001 9:57 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Auto load PHP David Balatero wrote: Maybe after the UPDATE statement, you could do: ?php header("Location: /path/to/other/script.php"); ? ...but I don't know, I don't use header() that much. -- David Balatero -Original Message- From: Jim Ray [mailto:[EMAIL PROTECTED]] Sent: Monday, April 02, 2001 6:23 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Auto load PHP Is there a way, once updating a table to load another PHP? After, I have the user click on the save button, the code calls a update routine. After the UPDATE is done, I want the code to call another progam. Thank you. Jim Yep... the header-function should work. There's only one nasty restriction... You can only use the header-function BEFORE ANY OTHER OUTPUT HAS BEEN GENERATED. -- * RzE: *** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 *** -- 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] duplicate a table
Hi, just install phpMyAdmin which has a feature to duplicate tables structure only or structure and data. ""McShen"" [EMAIL PROTECTED] schrieb im Newsbeitrag 9aak89$ruv$[EMAIL PROTECTED]">news:9aak89$ruv$[EMAIL PROTECTED]... how do i duplicate a table? i tried create table refer2 select * from refer; create table refer2 as select * from refer; they didn't work. my mysql version is mysql 3.22.28, -- 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] duplicate a table
I installed mySQLFront and it can do the same thing too through a GUI. You save a *.sql file with or without data. All the Best Lisa -Original Message- From: Johannes Janson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 03, 2001 2:36 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] duplicate a table Hi, just install phpMyAdmin which has a feature to duplicate tables structure only or structure and data. ""McShen"" [EMAIL PROTECTED] schrieb im Newsbeitrag 9aak89$ruv$[EMAIL PROTECTED]">news:9aak89$ruv$[EMAIL PROTECTED]... how do i duplicate a table? i tried create table refer2 select * from refer; create table refer2 as select * from refer; they didn't work. my mysql version is mysql 3.22.28, -- 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] php.exe Application Error. The instruction at 0x77fca2bf referenced memory at 0x32343662. The memory could not be written.
Hi, I've read the archive looking for a solution for this, I only found people with the same problem, but no answer... But.. I'll try. I have php4.04, Win2k, IIS5 and MS SQL7.0 I've read readme.txt, a thousand of times, I've uncommented extension=php_mssql70.dll, I've copied all the dlls to c:\winnt\system32, I've done every possible solution given at php.net even with dl('php_mssql70.dll'); but nothing works, I always get php.exe Application Error. The instruction at "0x77fca2bf" referenced memory at "0x32343662". The memory could not be "written". I read a post about undefined references... well this is my code, tell me if it's wrong. ? $con = mssql_connect("server","user","pass"); //This works fine if (mssql_select_db("MexMatch",$con)) { //this works fine. $query= "select * from Usuario"; $result = mssql_query("select * from usuario",$con); //I get the error message here. $array = mssql_fetch_array($result); echo $array{"Alias"}; } mssql_close($con); ? Thanks. http://www.qbien.com/J e s s E s t r a d a G i l Development Manager Qnet, S.A. de C.V. Mexico City Tel: (52)5209.3535 Fax: (52)5209.3536 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] _ Advertencia: Este correo electrnico y cualquier archivo que se transmita junto con l son confidenciales y para uso exclusivo del individuo o la entidad a la que van dirigidos. La utilizacin de cualquier informacin contenida en el mismo por personas no autorizadas puede dar lugar a procesos civiles o criminales, o ambos. Si usted recibi este correo electrnico por error, favor de notificar a su gerente de sistemas y al remitente, y destruir todas las copias de esta misiva. Aviso de no Responsabilidad: Es responsabilidad suya escanear esta comunicacin y los archivos adjuntos para detectar cualquier virus u otro defecto. QNET no acepta ninguna responsabilidad legal por daos o prdidas (ya sean directos, indirectos, a consecuencia u econmicos) sin importar la causa, ya sean por negligencia u otras causas, que puedan surgir como resultado directo o indirecto de esta comunicacin o los archivos adjuntos. En todo caso, nuestra responsabilidad se limita al costo de proporcionar de nuevo esta comunicacin.
[PHP-DB] Re: easy db question
Are you deleting them one by one? If you set a condition for the deleting, then the auto_increment value won't go back to zero, but if you just delete all it will. For example, if you say: delete from my_table where 10; it won't reset the value. But if you just say: delete from my_table; it should reset the value to zero. -Angela -- 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] Problems with MySQL
Hello, I've just installed a porgram that uses PHP4 to access a MySQL database. The problem is that I get the following error when I try to access the PHP file via web : Warning: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) in /usr/local/hlstats/hlstatsinc/db.inc on line 65 The strange thing about this is that MySQL leaves the mysqld.sock in /tmp, not in the directory that the error reports. I've just installed MySQL v3.23, and I had v3.22 before, which had it's sock file on /var/run/mysqld. ¿Could it be possible that PHP is fetching an old config file somewhere? I read in another forum that this could also happen if you used an old MySQL client with a newer version, ¿Could this be the case? ¿How does PHP comunnicate with MySQL? Thank you for your help. Greetings Bruno ([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 with MySQL
* Bruno ([EMAIL PROTECTED]) wrote: The strange thing about this is that MySQL leaves the mysqld.sock in /tmp, not in the directory that the error reports. I've just installed MySQL v3.23, and I had v3.22 before, which had it's sock file on /var/run/mysqld. You might want to make sure your path points to the newer version of mysql then, and not an old outdated one. Make sure you've removed all binary (for that matter all source) files for Mysql-3.22 if you've upgraded to 3.23. If in doubt, type which mysql and see if that's where you think it lives. Jeffrey -- 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] Validating forms
Do both, javascript and server side validation. Javascript can cut down on unnessary page refreshes. Serverside is the only way to guarentee the results, because of the reasons outlined here. Yes, it's more work, but it will provide a better experience for the end surfer. No? -Joe ""B. van Ouwerkerk"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... It is much more efficient to do that type of validation client-side, using Javascript. No sense in making another round trip to the server if not necessary. True.. but this only works if your visitor has javascript enabled.. the biggest avantage in serverside scripting IMHO is you can forse things to happen.. Besides, a visitor with a rather old browser might get bombed with javascript errors.. An if .. then loop will do the same but.. serverside. Bye, B. -- 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] iODBC Mac OS X HOWTO
Okay, so no attachments to the lists :) Here is the HOWTO: http://www.iodbc.org/osxphp_iodbc.htm Best regards, Andrew -- Andrew Hill - OpenLink Software Director Technology Evangelism eBusiness Infrastructure Technology http://www.openlinksw.com office:781.273.0900 x 27 mobile:781.608.4217 Hi all, In the past couple of weeks, many people have asked me about compiling PHP / Apache under Mac OS X, so I've updated my iODBC HOWTO specifically for Mac OS X. This walks through the process of enabling ODBC support in PHP, so your Mac OS X PHP applications can pull data from any relational database. I'll be uploading it to the www.iodbc.org site, but if anyone would like to comment on the initial draft, it's attached to the post. Any and all feedback is welcome - tell me anything is not clear! -- 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] iODBC Mac OS X HOWTO
Hi all, In the past couple of weeks, many people have asked me about compiling PHP / Apache under Mac OS X, so I've updated my iODBC HOWTO specifically for Mac OS X. This walks through the process of enabling ODBC support in PHP, so your Mac OS X PHP applications can pull data from any relational database. I'll be uploading it to the www.iodbc.org site, but if anyone would like to comment on the initial draft, it's attached to the post. Any and all feedback is welcome - tell me anything is not clear! Best regards, Andrew -- Andrew Hill - OpenLink Software Director Technology Evangelism eBusiness Infrastructure Technology http://www.openlinksw.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]
[PHP-DB] iODBC Mac OS X HOWTO
Hi all, In the past couple of weeks, many people have asked me about compiling PHP / Apache under Mac OS X, so I've updated my iODBC HOWTO specifically for Mac OS X. This walks through the process of enabling ODBC support in PHP, so your Mac OS X PHP applications can pull data from any relational database. I'll be uploading it to the www.iodbc.org site, but if anyone would like to comment on the initial draft, it's attached to the post. Any and all feedback is welcome - tell me anything is not clear! Best regards, Andrew -- Andrew Hill - OpenLink Software Director Technology Evangelism eBusiness Infrastructure Technology http://www.openlinksw.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]
[PHP-DB] column names
HI, does anyone knows how to retrive information about the columns names of a table? I know that is possible to use show table mytable using isql but I need to get information about the columns using sql. that information is to be accessed with a php script. so, I'm looking for something resembling "select info from table" How may I supposed to do that? -- 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] column names
"SHOW FIELDS FROM $table" - Brian Tangible Networks www.tangible-networks.com -Original Message- From: Mauricio Junqueira [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 03, 2001 5:10 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] column names HI, does anyone knows how to retrive information about the columns names of a table? I know that is possible to use show table mytable using isql but I need to get information about the columns using sql. that information is to be accessed with a php script. so, I'm looking for something resembling "select info from table" How may I supposed to do that? -- 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] column names
Meir kriheli wrote: On Tuesday 03 April 2001 23:10, Mauricio Junqueira wrote: HI, does anyone knows how to retrive information about the columns names of a table? I know that is possible to use show table mytable using isql but I need to get information about the columns using sql. that information is to be accessed with a php script. so, I'm looking for something resembling "select info from table" How may I supposed to do that? Hi Mauricio, I guess you're using Interbase (isql). The system table your looking for is named RDB$RELATION_FIELDS Your select should be something like: select RDB$FIELD_NAME from RDB$RELATION_FIELDS where RDB$RELATION_NAME = 'your_table_name' I'm building a new system, and I don't have an installation of Interbase I can check this on. I've got it from the Interbase documentation (the LANGREF.pdf file). HTH Thank you so much, It was exactly what I was looking for. I will now give deep look on those system tables. -- 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] Some assistance please
Shannon, Try changing your last 'elseif' to an 'else'. It could be hanging on the else-if syntax. Rich - Original Message - From: "Shannon Doyle" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 03, 2001 6:27 AM Subject: [PHP-DB] Some assistance please Hi People, I have a sql query running an array'd result that should echo a different result depending on the result of the query. However, it successfully does one of the entries from the query, but then appears to stop. With no further results displayed. Could someone take a look at the code at the bottom of this email and see if they can determine why it is not continuing through the rest of the results. Thanks in advance - Shannon ? $roundnum = ""; $sql = "select * from results order by round"; $dbh = @mysql_connect($dbhost,$dbuser,$dbpass); $results = mysql_db_query($db,$sql,$dbh); for($i = 0; $i mysql_num_rows($results); $i++) { $array[$i] = mysql_fetch_array($results); } mysql_close($dbh); for ($i = 0; $i count($array); $i++) { if ($array[$i]["round"] != $roundnum) { $roundnum = $array[$i]["round"]; echo "trtd colspan='5'brp align='center'bfont color='#99'Round ".$roundnum."/font/b/p/td/tr"; echo "trtd width='100'p".$array[$i]["home"]."/p/tdtd width='10'p".$array[$i]["home_goals"]."/p/tdtd width='50'\n"; if ($array[$i]["home_goals"] $array[$i]["away_goals"]) { echo "pDefeated/p/td"; } elseif ($array[$i]["home_goals"] $array[$i]["away_goals"]) { echo "pDefeated by/p/td"; } elseif ($array[$i]["home_goals"] == $array[$i]["away_goals"]) { echo "pDrew/p/td"; } echo "td width='100'p".$array[$i]["away"]."/p/tdtd width='10'p".$array[$i]["away_goals"]."/p/td\n"; } } ? -- 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] PHP4.0.4 segfaults with odbc_pconnect
So close and yet so far away... is there an "odbcping" type program? If we run "odbcping" on the SQL2000 server, it works fine (to itself of course, but using the ODBC settings AFAIK). [root=pts/1]2:08pm@content:{/usr/local/openlink/bin} setenv LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib ODBCINSTINI=/usr/local/openlink/bin/odbcinst.ini ODBCINI=/usr/local/openlink/bin/odbc.ini [root=pts/1]2:08pm@content:{/usr/local/openlink/bin} cat odbc.ini [ODBC Data Sources] OpenLink = OpenLink Generic ODBC Driver TattooReader = Tattoo Database on SQL2000 server [TattooReader] Driver = /usr/local/openlink/lib/oplodbc.so.1 Description = TattooReader Host= 10.2.3.11 ServerType = SQLServer 2000 FetchBufferSize = 99 UserName= Tattoo_reader Password= a4w59 Database= wt_updater_checkin ServerOptions = ConnectOptions = Options = ReadOnly= yes Trace = 0 TraceFile = /tmp/iodbc.trace [OpenLink] Driver = /usr/local/openlink/lib/oplodbc.so.1 Description = Sample OpenLink DSN Host= 10.2.3.11 ServerType = SQLServer 2000 FetchBufferSize = 99 UserName= Tattoo_reader Password= a4w59 Database= wt_updater_checkin ServerOptions = ConnectOptions = Options = ReadOnly= yes Trace = 0 TraceFile = /tmp/iodbc.trace [Default] Driver = /usr/local/openlink/lib/oplodbc.so.1 [root=pts/1]2:08pm@content:{/usr/local/openlink/bin} cat odbcinst.ini [ODBC Drivers] OpenLink Generic ODBC Driver = Installed TattooReader = Installed [OpenLink Generic ODBC Driver] Driver = /usr/local/openlink/lib/oplodbc.so.1 Setup = /usr/local/openlink/lib/oplodbc.so.1 [TattooReader] Driver = /usr/local/openlink/lib/oplodbc.so.1 Setup = /usr/local/openlink/lib/oplodbc.so.1 [root=pts/3]3:59pm@content:{/usr/local/openlink/bin} ./odbctest OpenLink ODBC Demonstration program This program shows an interactive SQL processor Enter ODBC connect string (? shows list): ? DSN| Description --- OpenLink | OpenLink Generic ODBC Driver TattooReader | Tattoo Database on SQL2000 server Enter ODBC connect string (? shows list): DSN=TattooReader select * from blah exit the only way to exit this is to kill the process, "exit" doesn't work. So, I'm not getting any errors anymore, but it's not doing anything either. Now we haven't ruled out the firewall as a possible problem here, however I can: [root=pts/3]3:59pm@content:{/usr/local/openlink/bin} telnet 10.2.3.11 1433 Trying 10.2.3.11... Connected to 10.2.3.11. Escape character is '^]'. ^[ ^[^[ ^[^[^[ ^[^[ ^[ ^[ but as you can see, ^] doesn't Escape. In fact, the only way to stop it is to kill the telnet process from another shell. SHOULD I be able to do anything from the telnet prompt? Like with HTTP, you can get it to spew out a web page, is there some command to run to make sure the connection is all good in both directions? [root=pts/2]4:03pm@content:{/root} netstat Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp0 0 xxx.xxx.xxx.xxx:1096 10.2.3.11:1433 ESTABLISHED notice that the ports don't line up. should they? my MIS guy says that's normal and there's just a pool of ports the OS picks from and will 'map' them correctly (in lay terms). and FWIW, the PHP example STILL segfaults. I would expect it to through up an error, not segfault... that can't be good can it? daevid.com -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, April 02, 2001 8:08 PM To: Daevid Vincent; [EMAIL PROTECTED]; PHP General Subject: Re: [PHP-DB] PHP4.0.4 segfaults with odbc_pconnect Daevid, connection script snipped (looked fine) $dsn="DSN=OpenLink"; // this is a valid DSN set up in the above odbc.ini //$conn_id = odbc_connect("DSN=OpenLink;UID=daevid;PWD=secret","",""); ? -- [OpenLink] Driver = /usr/local/openlink/lib/oplodbc.so.1 Description = Sample OpenLink DSN Host= 10.2.3.11 ServerType = Oracle 8.1.x FetchBufferSize = 99 UserName= daevid Password= secret Database= mydatabase ServerOptions = ConnectOptions = Options = ReadOnly= yes Trace = 0 TraceFile = /tmp/iodbc.trace [Default] Driver = /usr/local/openlink/lib/oplodbc.so.1 Is "ServerType = Oracle 8.1.x" right? I'm