[PHP-DB] Supplied argument is not a valid File-Handle resource in
Dear All, I use this script if ( ($type == all or $type == com) and $com_include ) { $com_array = array($ddomain..com,$ddomain..net); $com_count = count($com_array); $i=0; for ($i=0;$i$com_count;$i++) { $domname = $com_array[$i]; $ns = fsockopen($com_server,43); fputs($ns,$domname\r\n); $result = ''; while(!feof($ns)) $result .= fgets($ns,128); fclose($ns); if (eregi($com_nomatch,$result)) { dispav($domname); } else { dispun($domname,$com_server); } } echo 'trtd colspan=5 class=separatornbsp;/td/tr'; } my PHP Version 4.1.2 And I get Warning : Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site1/web/whoisnew.php on line 584 Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site1/web/whoisnew.php on line 586 Anyone can help me ? Thanks a lot -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] fopen : Supplied argument is not a valid File-Handle resource
Dear All, I use this script if ( ($type == all or $type == com) and $com_include ) { $com_array = array($ddomain..com,$ddomain..net); $com_count = count($com_array); $i=0; for ($i=0;$i$com_count;$i++) { $domname = $com_array[$i]; $ns = fsockopen($com_server,43); fputs($ns,$domname\r\n); $result = ''; while(!feof($ns)) $result .= fgets($ns,128); fclose($ns); if (eregi($com_nomatch,$result)) { dispav($domname); } else { dispun($domname,$com_server); } } echo 'trtd colspan=5 class=separatornbsp;/td/tr'; } my PHP Version 4.1.2 And I get Warning : Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site1/web/whoisnew.php on line 584 Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site1/web/whoisnew.php on line 586 Anyone can help me ? Thanks a lot -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] [fwd] Sybase (from: stephanb@whacky.net)
Since I have gotten 0 (zero) response on the problem below, let me try again. Also, I kept trying to work with it, and I found out that a sybase_connect from a php shellscript does work, but it won't work from inside a php handled webpage. This is even stranger. I also found a way to up the level of error output I get, and now the php gives me this: ct_con_alloc(): unable to get layer message string: unable to get origin message string: error string not available I searched for this error, but found only people who had the same problem, but no solution. Isn't this odd when a script does work on the cmdline but not in a website ? I have never experienced this before. Please help. /Stephan - Forwarded message from Stephan van Beerschoten [EMAIL PROTECTED] - From: Stephan van Beerschoten [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Thu, 25 Sep 2003 22:47:33 +0200 Subject: Sybase User-Agent: Mutt/1.5.4i Hi all, As many, I'm forced to start my message too with the problem statement that I can't connect to my sybase database. I have to be more honest even in saying that I don't even know the difference in --enable-sybase and --enable-sybase-ct (I have tried both). I'm by no means an SQL nitwit.. I just never had to work with sybase before. I don't have any clue when it comes to sybase.. never worked with any, but I have to now. I have a login and can connect using isql and the database definition 'CST_SYB' which comes straight out of the sybase interfaces file. However I can't seem to get any php connections working. I can flood you with sybase_connect() examples, but they come straight from the manual. What am I missing ? Oh btw, I compiled my php using the orignal sybase openclient package in $SYBASE, but I also see people referring to 'freedts'? I assume this is a substitute in case no original sybase libs are available, right? Anyway, any pointers would be more then welcome. /Stephan -- Stephan van Beerschoten [SVB21-RIPE] [EMAIL PROTECTED] PGP fingerprint: 4557 9761 B212 FB4C 778D 3529 C42A 2D27 To err is human, to forgive is Not Company Policy - End forwarded message - -- Stephan van Beerschoten [SVB21-RIPE] [EMAIL PROTECTED] PGP fingerprint: 4557 9761 B212 FB4C 778D 3529 C42A 2D27 To err is human, to forgive is Not Company Policy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] database design question
i would add a second table and also store the totals in the lyrics table like you suggested then you can do things like top 10 this week / top 10 this month and make sure its not being abused LYRICS_RATINGS - id | lyric_id | rating | vote_date | remote_addr same idea for hits/impressions olinux --- John Ryan [EMAIL PROTECTED] wrote: ive a table called 'lyrics' which is the main content on my site, song lyrics. im thinking of introducing rate this lyric and all that kind of stuff into the site. would it be better, from a design point of view, to create a second table for lyrics ratings and hits or just add a 'ratings' and 'hits' field names to the exisitng table?? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] fopen : Supplied argument is not a valid File-Handle resource
On Monday 29 September 2003 15:30, Ferdian wrote: Please post to the correct list, this has nothing to do with databases. Please do not post multiple times. Wait patiently for a response! I use this script [snip] $ns = fsockopen($com_server,43); fputs($ns,$domname\r\n); $result = ''; while(!feof($ns)) $result .= fgets($ns,128); fclose($ns); if (eregi($com_nomatch,$result)) { dispav($domname); } else { dispun($domname,$com_server); } } echo 'trtd colspan=5 class=separatornbsp;/td/tr'; } my PHP Version 4.1.2 And I get Warning : Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site1/web/whoisnew.php on line 584 [snip] How about putting in some error checking code as per example in manual? -- 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-db -- /* Documentation: Instructions translated from Swedish by Japanese for English speaking persons. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Email bouncer Program(s) - know any?
Hi, I run PHP and mysql on my site. I allow people to use a PHP page to send me an email that is logged in the mysql for logging reasons. If someone sends me an email to [EMAIL PROTECTED] (fake address, not real) when it is sent it does not bounce, instead it gets sent to the root email account. :( I don't want this as I don't read the root account all the time because emails that go there are mainly spam or from people who do not have the correct email address to send to. I don't reply to any in there. Just delete them, they take up space sitting there. Is there a Program(s) I can download or change a setting on my server to make them bounce back with a message? (like other web server do) Sure I could setup a autoresponder of some kind but I don't want to reveal the root account email. Can anyone help? Also I host other sites and domains, if I install a program on my web server for my emails to bounce will they work for them? Preferrably is there a program I can use to just use for my domain? And others can ask for it to be installed for their accounts. All help mostly appreciated. Thanks! http://search.yahoo.com.au - Yahoo! Search - Looking for more? Try the new Yahoo! Search -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Defining relation between tables
Hi ; I am a new programmer of PHP4.3.3 an MySql 3.23 . In MyPhpAdmin CREATE DATABASE phpmyadmin; GRANT SELECT,INSERT,DELETE ON phpmyadmin.* to 'local host user'; enter the databasename in $cfg['Servers'][$i]['pmadb'] (this works) But the statement below dosen't work at all. CREATE TABLE `PMA_bookmark` ( id int(11) DEFAULT '0' NOT NULL auto_increment, dbase varchar(255) NOT NULL, user varchar(255) NOT NULL, label varchar(255) NOT NULL, query text NOT NULL, PRIMARY KEY (id) ) TYPE=MyISAM COMMENT='Bookmarks'; enter the tablename in $cfg['Servers'][$i]['bookmarktable'] CREATE TABLE `PMA_relation` ( `master_db` varchar(64) NOT NULL default '', `master_table` varchar(64) NOT NULL default '', `master_field` varchar(64) NOT NULL default '', `foreign_db` varchar(64) NOT NULL default '', `foreign_table` varchar(64) NOT NULL default '', `foreign_field` varchar(64) NOT NULL default '', PRIMARY KEY (`master_db`, `master_table`, `master_field`), KEY foreign_field (foreign_db, foreign_table) ) TYPE=MyISAM COMMENT='Relation table'; put the relation table name in $cfg['Servers'][$i]['relation'] CREATE TABLE `PMA_table_info` ( `db_name` varchar(64) NOT NULL default '', `table_name` varchar(64) NOT NULL default '', `display_field` varchar(64) NOT NULL default '', PRIMARY KEY (`db_name`, `table_name`) ) TYPE=MyISAM COMMENT='Table information for phpMyAdmin'; put the table name in $cfg['Servers'][$i]['table_info'] CREATE TABLE `PMA_column_comments` ( id int(5) unsigned NOT NULL auto_increment, db_name varchar(64) NOT NULL default '', table_name varchar(64) NOT NULL default '', column_name varchar(64) NOT NULL default '', comment varchar(255) NOT NULL default '', PRIMARY KEY (id), UNIQUE KEY db_name (db_name, table_name, column_name) ) TYPE=MyISAM COMMENT='Comments for Columns'; put the table name in $cfg['Servers'][$i]['column_comments'] in the CONFIG.INC.PHP $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';// Database used for Relation, Bookmark and PDF Features // - leave blank for no support $cfg['Servers'][$i]['bookmarktable'] = 'PMA_bookmark'; // Bookmark table - leave blank for no bookmark support $cfg['Servers'][$i]['relation'] = 'PMA_relation'; // table to describe the relation between links (see doc) // - leave blank for no relation-links support $cfg['Servers'][$i]['table_info']= 'PMA_table_info';// table to describe the display fields // - leave blank for no display fields support $cfg['Servers'][$i]['table_coords'] = 'PMA_table_coords'; // table to describe the tables position for the PDF // schema - leave blank for no PDF schema support $cfg['Servers'][$i]['pdf_pages'] = 'PMA_pdf_pages'; // table to describe pages of relationpdf // - leave blank if you don't want to use this $cfg['Servers'][$i]['column_comments'] = 'PMA_column_comments'; // table to store columncomments // - leave blank if you don't want to use this Inspite of every things have done when I try to use the tables in the one of a database MyPhpAdmin sends this message so I can't define any relation between two tables. first ; The message is something like this The extra features that were used to work with the related tables, were deactivated. second;PMA Database ... ok relation Table ... not activated. table_info ... not activated table_coords ... not activated pdf_pages ... not activated creating PDF ... not activated column_comments ... not activated show of column comment : not activated Please help me. thanks for your attentions. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] [fwd] Sybase (from: stephanb@whacky.net)
Hi list. I had the same problem when trying to use Sybase_Connect ... Insted i defined alias in ODBC and used OBDC_Connetc. JPedro - Original Message - From: Stephan van Beerschoten [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 29, 2003 8:52 AM Subject: [PHP-DB] [fwd] Sybase (from: [EMAIL PROTECTED]) Since I have gotten 0 (zero) response on the problem below, let me try again. Also, I kept trying to work with it, and I found out that a sybase_connect from a php shellscript does work, but it won't work from inside a php handled webpage. This is even stranger. I also found a way to up the level of error output I get, and now the php gives me this: ct_con_alloc(): unable to get layer message string: unable to get origin message string: error string not available I searched for this error, but found only people who had the same problem, but no solution. Isn't this odd when a script does work on the cmdline but not in a website ? I have never experienced this before. Please help. /Stephan - Forwarded message from Stephan van Beerschoten [EMAIL PROTECTED] - From: Stephan van Beerschoten [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Thu, 25 Sep 2003 22:47:33 +0200 Subject: Sybase User-Agent: Mutt/1.5.4i Hi all, As many, I'm forced to start my message too with the problem statement that I can't connect to my sybase database. I have to be more honest even in saying that I don't even know the difference in --enable-sybase and --enable-sybase-ct (I have tried both). I'm by no means an SQL nitwit.. I just never had to work with sybase before. I don't have any clue when it comes to sybase.. never worked with any, but I have to now. I have a login and can connect using isql and the database definition 'CST_SYB' which comes straight out of the sybase interfaces file. However I can't seem to get any php connections working. I can flood you with sybase_connect() examples, but they come straight from the manual. What am I missing ? Oh btw, I compiled my php using the orignal sybase openclient package in $SYBASE, but I also see people referring to 'freedts'? I assume this is a substitute in case no original sybase libs are available, right? Anyway, any pointers would be more then welcome. /Stephan -- Stephan van Beerschoten [SVB21-RIPE] [EMAIL PROTECTED] PGP fingerprint: 4557 9761 B212 FB4C 778D 3529 C42A 2D27 To err is human, to forgive is Not Company Policy - End forwarded message - -- Stephan van Beerschoten [SVB21-RIPE] [EMAIL PROTECTED] PGP fingerprint: 4557 9761 B212 FB4C 778D 3529 C42A 2D27 To err is human, to forgive is Not Company Policy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] odbc
I am trying to connect to an AS/400 from a Linux box running RH9. I have installed unixODBC and the iSeries drivers. I can run cwbping that tell me that I am connecting to the AS400. I have made a scipt the following script - HTML HEADTITLEODBC Data Source/TITLE/HEAD BODY ?php //odbc_query.php $odbc_dsn = sysDSN; $odbc_userid = RADCUR; $odbc_password = sacsac; $query = select * from radtcur.nfp; if(!($odbc_db = odbc_connect($odbc_dsn, $odbc_userid, $odbc_password))) die(Could not connect to ODBC data source $odbc_dsn); if(!($odbc_rs = odbc_exec($odbc_db, $query))) die(Error executing query $query); odbc_result_all($odbc_rs); ? /TABLE /BODY /HTML When I run this script from a web browser I get the following error in my http error logs [client 172.16.32.241] PHP Warning: odbc_exec(): SQL error: [unixODBC][IBM][iSeries Access ODBC Driver][DB2 UDB], SQL state S1000 in SQLExecDirect in /var/www/htdocs/odbcquery.php on line 15 Does anyone know why I am getting this? Thank you for your time Doug -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Help with UPDATE query
Hi, I have two columns in my Bookings table of type DATETIME - Booking_Start_Date and Boking_End_Date. How can i update every row so that all of the times for Booking_Start_Date are 09.00 and all of the times for Booking_End_Date are 17.30, without affecting any of the dates? Thanks for your help -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Query's
Howdy List, I am a little confused in incorporating a drop down menu into my select statement. I have a very simple 1 table database that contains my DVD collection. Right now - very simply it connects to the database, and then produces the results of the search based on a ? mysql_connect(localhost,name,password); mysql_select_db(oldmovies); $result = mysql_query (SELECT * FROM movies); while($r=mysql_fetch_array($result)) { $movie_number=$r[movie_number]; $movie_name=$r[movie_name]; $genre=$r[genre]; $star1=$r[star1]; $star2=$r[star2]; $star3=$r[star3]; $director=$r[director]; $brief_synopsis=$r[brief_synopsis]; $imdb_link=$r[imdb_link]; ? This then produces the results onto the page in the tables that I have formatted. This was fine when I only had 50 or so dvd's - I am nearing the 500 mark, and it is WAY past time to add a search This is where I get lost. I can get into mysql monitor, and I can pull out using SELECT * FROM movies WHERE genre LIKE *** And then I have a selection of Genre's that I can enter to generate the results. What I am trying to do is incorporate some selection drop down menus that would make the search process easier. Example: search for movies where {dropdown1} is {equal or like} Dropdown 1 would be my first criteria: movie name, director, lead actor, genre. The equal or like would be a standard textfield to be filled in. I hope that I am making sense here. If anybody can shed some light onto a confused newbie (the php script above was written at my old place of employment for me - otherwise I could ask them) it would be greatly appreciated. Thank you Andrew -- Come to the edge, Life said. They said: We are afraid. Come to the edge, Life said. They came. It pushed them...and they FLEW. -Guillaume Apollinaire 1870-1918 --- Once you have tasted flight, you will walk the earth with your eyes turned skyward, for there you have been and there you long to return. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Query's
Are you asking for help with the query, or with having the query populate a select box? If you are planning to be able to manually enter search criteria, then you do not want a select box, you want a text type input. David Andrew R [EMAIL PROTECTED] 09/29/2003 05:01 PM To: [EMAIL PROTECTED] cc: Subject: [PHP-DB] Query's Howdy List, I am a little confused in incorporating a drop down menu into my select statement. I have a very simple 1 table database that contains my DVD collection. Right now - very simply it connects to the database, and then produces the results of the search based on a ? mysql_connect(localhost,name,password); mysql_select_db(oldmovies); $result = mysql_query (SELECT * FROM movies); while($r=mysql_fetch_array($result)) { $movie_number=$r[movie_number]; $movie_name=$r[movie_name]; $genre=$r[genre]; $star1=$r[star1]; $star2=$r[star2]; $star3=$r[star3]; $director=$r[director]; $brief_synopsis=$r[brief_synopsis]; $imdb_link=$r[imdb_link]; ? This then produces the results onto the page in the tables that I have formatted. This was fine when I only had 50 or so dvd's - I am nearing the 500 mark, and it is WAY past time to add a search This is where I get lost. I can get into mysql monitor, and I can pull out using SELECT * FROM movies WHERE genre LIKE *** And then I have a selection of Genre's that I can enter to generate the results. What I am trying to do is incorporate some selection drop down menus that would make the search process easier. Example: search for movies where {dropdown1} is {equal or like} Dropdown 1 would be my first criteria: movie name, director, lead actor, genre. The equal or like would be a standard textfield to be filled in. I hope that I am making sense here. If anybody can shed some light onto a confused newbie (the php script above was written at my old place of employment for me - otherwise I could ask them) it would be greatly appreciated. Thank you Andrew -- Come to the edge, Life said. They said: We are afraid. Come to the edge, Life said. They came. It pushed them...and they FLEW. -Guillaume Apollinaire 1870-1918 --- Once you have tasted flight, you will walk the earth with your eyes turned skyward, for there you have been and there you long to return. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Help with UPDATE query
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hi, I have two columns in my Bookings table of type DATETIME - Booking_Start_Date and Boking_End_Date. How can i update every row so that all of the times for Booking_Start_Date are 09.00 and all of the times for Booking_End_Date are 17.30, without affecting any of the dates? Thanks for your help Off the top of my head - use mysql's DATE_FORMAT to build a date string, then concatenate the required time string and use that as the update value. Something like UPDATE table SET Booking_Start_date = CONCAT(DATE_FORMAT(Booking_Start_Date, your format here),'09.00'), Booking_End_date = CONCAT(DATE_FORMAT(Booking_End_Date, your format here),'17.30'); You'll need to play a bit with that - and of course test on a backup. Cheers -- Quod subigo farinam A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] how to select rows with repeated coloumns in one query????
I have a table called studs with coloumns as : Sno.namegrade 1 aa 1 2 bb 1 3 cc 2 4 dd 3 5 ee 4 6 ff 4 7 gg 4 8 hh 5 Now i want to see only those rows which have value of grade repeated atleast in one other row i.e. The result should contain row no's 1,2(with grade 1) and 5,6,7(with grade 4) in two queries this cud be done as : select sno, count(grade) as cnt from studs group by grade having cnt1 and then select * from studs where sno in ('result of previous query') -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php