php-windows Digest 2 Feb 2001 06:48:22 -0000 Issue 424 Topics (messages 5315 through 5330): MySql Connect Problem between Win and Linux 5315 by: Robert Trembath Exec() In Windows 5316 by: Keith Stevenson Re: Nulls in database 5317 by: Larry Forrister 5319 by: Toby Miller 5322 by: Svensson, B.A.T. Re: Newbie - Help!!!!! 5318 by: Toby Miller Fixed it 5320 by: Robert Trembath Re: [PHP] Nulls in database 5321 by: Carlos Andre Marques Moreira Re: [PHP-WINDOWS] PHP4RC2+Apache+Win 5323 by: Christopher Derr passing arrays of objects 5324 by: Conover, Ryan 5326 by: Doug Brewer Re: Problem with Oracle 5325 by: Matt Hopkins Formatting Date 5327 by: Ben Cairns 5328 by: Flint Doungchak 5329 by: Matthew Hopkins FORMATTING HTML IN AND OUT OF MYSQL 5330 by: Bikes Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
For some reason the configuration when set to localhost for the mysql server works on Windows/PHP in Apache and IIS5 but on Linux I get: Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /var/www/html/iShopHouston/NewVehicles.php on line 10 Couldn't connect to MySQL
Hi, Im having a Problem running an application from a PHP page using the Exec() function (as well as all the other program execution fuctions) on a Windows NT Server running Apache. The code I attempt to run is : $ReturnVal = exec("Application.exe"); It returns with Unable to Fork.... Does any body have any idea on how to fix this or an alternative so I can just run the damm application.... Cheers
Try: [Start Construction Date] is null or: [Start Construction Date] is not null ~~LF "Conover, Ryan" wrote: > I am trying to write a query to bring back rows that have null values set in > them. I cannot figure out how to do this. I can bring back all rows that do > not have nulls with the following query. > > SELECT [ID], [Project Name], [Start Construction Date], [Actual Completion > Date] > FROM common WHERE [Start Construction Date] != ' ' OR [Actual Completion > Date] != ' ' > > I tried changing the != to = but it does not return anything. > > I am running these queries off a MSSQL 7.0 Server > > Ryan > > -- > PHP Windows 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]
You are trying to compare for a value that does not match, correct? Try this: SELECT [ID], [Project Name], [Start Construction Date], [Actual Completion Date] FROM common WHERE [Start Construction Date] <> '' OR [Actual Completion Date] <> '' Also, your query was saying if [Start Construction Date] is not equal to ' ' (space character). In SQL the not equal to comparison "!=" is actually "<>". -Toby ----- Original Message ----- From: "Richard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 01, 2001 12:06 PM Subject: RE: [PHP-WIN] Nulls in database > I don't know ANYTHING about ANY of this stuff...but where I come from (C) > you would use 2 equal signs (==) to match values. Dunno if that applies > here, but usually when you use 1 equal sign, you are assigning values. > > Rick > > -----Original Message----- > From: Conover, Ryan [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 01, 2001 12:05 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: [PHP-WIN] Nulls in database > > > I am trying to write a query to bring back rows that have null values set in > them. I cannot figure out how to do this. I can bring back all rows that do > not have nulls with the following query. > > SELECT [ID], [Project Name], [Start Construction Date], [Actual Completion > Date] > FROM common WHERE [Start Construction Date] != ' ' OR [Actual Completion > Date] != ' ' > > I tried changing the != to = but it does not return anything. > > I am running these queries off a MSSQL 7.0 Server > > Ryan > > -- > PHP Windows 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 Windows 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] >
>I am trying to write a query to bring back rows that have null >values set in them. Try write WHERE [Start Construction Date] IS NULL OR [Actual Completion Date] IS NULL or alternatively selecting both nulls and empty attributes with or without white spaces: WHERE isnull([Actual Completion Date], '') = '' OR isnull([Start Construction Date]. '') = ''
Everything the errors are pointing to is the result reference returned in $result. If your query fails and you just try to read the result you will get that error. Try something like this: $result = mysql_query( "SELECT * from nctd_reviews WHERE model_year='$year' AND manufacturer_name='$make' ORDER BY 'model_year','manufacturer_name'" ); if ((!$result) || (mysql_num_rows($result) < 1)) { if (mysql_error() != "") { print ("There were no results"); } else { die ("SQL Error: " . mysql_error()); } } else { // continue, this is a valid returned result set } Let me know if this helps. -Toby ----- Original Message ----- From: "Tom Mathews" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, February 01, 2001 11:15 AM Subject: Re: [PHP-WIN] Newbie - Help!!!!! > If there was an error with the DB connection, then the 'or die' clause should > pick it up? > If nothing has changed between the IIS nad Apache implementation then I don't > know what is happenning > If however you have changed the table structure at the same time... or maybe > don't have any records on your DB? > > Tom > > Toby Miller wrote: > > > There seems to be a problem with your database connection. Can we see the > > header include? > > > > -Toby > > > > ----- Original Message ----- > > From: "Robert Trembath" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Thursday, February 01, 2001 10:20 AM > > Subject: [PHP-WIN] Newbie - Help!!!!! > > > > I don't understand why I getting an error on this. it ran on my IIS/PHP > > machine but on my Apache/PHP I get errors. Here the code and the results, > > Please help: > > > > <?php > > session_start(); > > include("./inc/php_header.php") > > ?> > > <font face=Arial size=2> > > <?php > > include("./mysql_connect_inc.php"); > > print "<h3>New Vehicle Search</h3><p>"; > > mysql_select_db( $db ) > > or die ( "Couldn't open $db: ".mysql_error() ); > > $result = mysql_query( "SELECT * from nctd_reviews WHERE > > model_year='$year'AND manufacturer_name='$make' ORDER BY 'model_year', > > 'manufacturer_name'" ); > > $rows = mysql_num_rows( $result ); > > print "There are currently $rows vehicles that match your criteria.<p>"; > > print "<table width=475 border=0 cellpadding=0 cellspacing=1>\n"; > > print "<tr bgcolor=#D0D4E8><td width=50><font > > size=2><b>Year</b></font></td>"; > > print "<td width=325><font size=2><b>Make & Model</b></font></td><td > > width=100><font size=2><b>MSRP</b></font></td></tr>"; > > while ($r = mysql_fetch_array($result)) > > { > > extract($r); > > print "<tr>\n"; > > print "<td><font size=2>$model_year</font></td><td><font size=2><a > > href='vehicledetail.php?id=$ID'>$manufacturer_name > > $model_name</a></font></td><td><font size=2>$ $base_price</td></font>\n"; > > print "</tr>\n"; > > $selectedyear = "$year"; > > $selectedmake = "$make"; > > } > > print "</font></table>\n"; > > mysql_close( $link ); > > include("./inc/php_footer.php") > > ?> > > > > Now the errors: > > > > Warning: Supplied argument is not a valid MySQL result resource in > > c:\apache\htdocs\ishophouston\newvehicles.php on line 12 > > There are currently vehicles that match your criteria. > > Year Make & Model MSRP > > > > Warning: Supplied argument is not a valid MySQL result resource in > > c:\apache\htdocs\ishophouston\newvehicles.php on line 17 > > > > -- > > PHP Windows 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 Windows 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]
Nevermind. It turned out to be a case-sensitivity issue between Windows and Linux in the MySQL Query. Excuse me for being Stupid.;-) Robert
Actually you should use is null, or is not null (if you want to retrieve the rows that don't have null values), either uppercase or lowercase. Your query should be something like that: SELECT [ID], [Project Name], [Start Construction Date], [Actual Completion Date] FROM common WHERE [Start Construction Date] is null OR [Actual Completion Date] is null -----Original Message----- From: Juan [mailto:[EMAIL PROTECTED]] Sent: quinta-feira, 1 de fevereiro de 2001 14:15 To: Conover, Ryan Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Nulls in database Réponse au message | [PHP] Nulls in database | du jeudi 1 février 2001, 18:05 : This is from memory concerning my old SQL class but isn't there something specific in sql lines saying that to find null values you should use : ISNULL Since an empty string is different from a null entry. CR> I am trying to write a query to bring back rows that have null values set in CR> them. I cannot figure out how to do this. I can bring back all rows that do CR> not have nulls with the following query. CR> SELECT [ID], [Project Name], [Start Construction Date], [Actual Completion CR> Date] CR> FROM common WHERE [Start Construction Date] != ' ' OR [Actual Completion CR> Date] != ' ' CR> I tried changing the != to = but it does not return anything. CR> I am running these queries off a MSSQL 7.0 Server CR> Ryan _______________________________________ Massuelles Jean-Baptiste([EMAIL PROTECTED]) Société A Comme... Tel : 03 80 700 702
The new PHP 4.04pl1 has Apache Win32 module support. Instructions are in the download. Chris Giacomo Falchetti wrote: > Can PHP4 run as an Apache module on Win9x? > I'd like to use HTTP Basic Authentication, and the CGI interface don't set > the PHP_AUTH_USER variable. > > TIA, Giacomo > > BEGIN:VCARD > VERSION:2.1 > N:Falchetti;Giacomo;Roberto Stefano;Rag.Prog. > FN:GIACOMO Falchetti > NICKNAME:falco > ORG:Digital Age srl > TEL;WORK;VOICE:0717202115 > ADR;WORK:;;via Chiusa 6;OSIMO;AN;;ITALIA > LABEL;WORK;ENCODING=QUOTED-PRINTABLE:via Chiusa 6=0D=0AOSIMO, AN=0D=0AITALIA > REV:19990615T110231Z > END:VCARD > -----Messaggio originale----- > Da: Marc Ryan Ray <[EMAIL PROTECTED]> > A: [EMAIL PROTECTED] <[EMAIL PROTECTED]> > Data: lunedì 22 maggio 2000 18.25 > Oggetto: [PHP-WINDOWS] php4-functions specifically ftp > > Does PHP4 for windows support all of the php4 functions in > the binary version? I tried using the ftp_connect command > and i get an undefined function error. Also does php4 > support odbc and mysql functions in the windows binary. Is > there a way to add support if it is not there. I know on > the unix versions commands like --with ftp can be used to > add support. Any help would be greatly appreciated. > > Marc Ray > [EMAIL PROTECTED] > [EMAIL PROTECTED] > > ___________________________________________________________________________ > Visit http://www.visto.com/info, your free web-based communications center. > Visto.com. Life on the Dot. > > -- > PHP Windows 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 Windows 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]
I was wondering if I can pass an array that has serialized objects to next page via url encoding $foo //array with serialized objects in it with the following encoding something/something/foobar.php?foo=echo($foo) and be able too unserialize $foo on the next page(foovar.php) ryan
try $foo //array with serialized objects in it $foo = rawurlencode($foo); $url = "something/something/foobar.php?foo=$foo"; and on the next page $foo = rawurldecode($foo); $foo = unserialize($foo); disclaimer: I didn't run thru these to see if it works although it might be better to pass it as a post arg--isn't there a length limitation on stuff passed via GET (?) DB | -----Original Message----- | From: Conover, Ryan [mailto:[EMAIL PROTECTED]] | Sent: Thursday, February 01, 2001 1:22 PM | To: [EMAIL PROTECTED]; [EMAIL PROTECTED] | Subject: [PHP-WIN] passing arrays of objects | | | I was wondering if I can pass an array that has serialized | objects to next | page via url encoding | | $foo //array with serialized objects in it | | with the following encoding | | something/something/foobar.php?foo=echo($foo) | | and be able too unserialize $foo on the next page(foovar.php) | | ryan | | -- | PHP Windows 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] |
If you haven't already done so try uncommenting the ;extension=php_oracle.dll in the Windows Extensions section of your php.ini file. Also I'd assume you would need to put the php_oracle.dll into a folder such as winnt\system32. Matt -----Original Message----- From: Bikes [mailto:[EMAIL PROTECTED]] Sent: 01 February 2001 14:21 To: 'Asendorf, John '; 'Jean-Christophe Le Brun '; '[EMAIL PROTECTED] ' Subject: RE: [PHP-WIN] Problem with Oracle I have a very big problem please. I installed Oracle on my Windows Professional server. However, whenever I try to call the Oracle OIC connect function, it tells me that the function is invalid. Please, I need to know if there is anything I need to do to enable me to connect to the Oracle server using PHP because I can connect to mySql on the same machine using the same PHP function for mySQL. Bikes > -- PHP Windows 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]
I have this line of code in a script: $todays_date=date("dmY"); It generates something like this: 01022001 What I need to do is get something like this from it: Thursday, February 01, 2001 Um, How? Thanks in adavance... -- Ben Cairns - Head Of Technical Operations intasept.COM Tel: 01332 365333 Fax: 01332 346010 E-Mail: [EMAIL PROTECTED] Web: http://www.intasept.com "MAKING sense of the INFORMATION TECHNOLOGY age @ WORK......"
Ben, Check out the date function in the php documentation. There's a lot of formatting option there. Go to php.net and type date in the quick ref field. -Flint -----Original Message----- From: Ben Cairns [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 01, 2001 2:00 PM To: [EMAIL PROTECTED] Subject: [PHP-WIN] Formatting Date I have this line of code in a script: $todays_date=date("dmY"); It generates something like this: 01022001 What I need to do is get something like this from it: Thursday, February 01, 2001 Um, How? Thanks in adavance... -- Ben Cairns - Head Of Technical Operations intasept.COM Tel: 01332 365333 Fax: 01332 346010 E-Mail: [EMAIL PROTECTED] Web: http://www.intasept.com "MAKING sense of the INFORMATION TECHNOLOGY age @ WORK......" -- PHP Windows 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]
The .chm file from php.net is very useful and one of the smallest formats to download. To get the output you need use; date("w, F d, Y") -Matt -----Original Message----- From: Flint Doungchak [mailto:[EMAIL PROTECTED]] Sent: 01 February 2001 22:10 To: 'Ben Cairns'; [EMAIL PROTECTED] Subject: RE: [PHP-WIN] Formatting Date Ben, Check out the date function in the php documentation. There's a lot of formatting option there. Go to php.net and type date in the quick ref field. -Flint -----Original Message----- From: Ben Cairns [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 01, 2001 2:00 PM To: [EMAIL PROTECTED] Subject: [PHP-WIN] Formatting Date I have this line of code in a script: $todays_date=date("dmY"); It generates something like this: 01022001 What I need to do is get something like this from it: Thursday, February 01, 2001 Um, How? Thanks in adavance... -- Ben Cairns - Head Of Technical Operations intasept.COM Tel: 01332 365333 Fax: 01332 346010 E-Mail: [EMAIL PROTECTED] Web: http://www.intasept.com "MAKING sense of the INFORMATION TECHNOLOGY age @ WORK......" -- PHP Windows 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 Windows 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]
I have a little problem. I need to allow my clients to update the news on their website via a form. The form is supposed to allow them input Latest news etc. and then it is written into a database, and taken out on the other end by then index page. The problem now, is that I when I put the text into the database, it is no more formatted when I am pulling the info out of the database. All the paragraphs, and line breaks are lost, and the whole text is lumped together. I need to be able to write the HTML of what the user typed into the database so I can "echo" out the info, representing <BR> with line breaks etc. Also, in the event that I do not use a database, is it possible to use files to achieve the same results? Eg "include files"? Thanks Bikes da Bikerider ------- Riding into the next century -------