php-general Digest 16 Apr 2001 06:07:44 -0000 Issue 630 Topics (messages 48643 through 48707): Access/SQL Server? 48643 by: Bob Clingan 48674 by: Brian Clark 48677 by: Andrew Hill Re: What's XML's Purpose?? 48644 by: Manuel Lemos 48645 by: Manuel Lemos Re: Display Formatted Query Results 48646 by: Manuel Lemos PCRE vs. POSIX 48647 by: bill 48648 by: CC Zona accepting credit cards 48649 by: Tyler Longren 48665 by: Tobias Talltorp list table by date 48650 by: Augusto Cesar Castoldi 48662 by: Seung-woo Nam SQL Query syntax error... Help? 48651 by: Scott VanCaster 48652 by: Augusto Cesar Castoldi 48653 by: Felix Kronlage 48654 by: Scott VanCaster 48655 by: Scott VanCaster 48656 by: Scott VanCaster 48657 by: Scott VanCaster 48658 by: Scott VanCaster 48659 by: Chris Cocuzzo 48660 by: Chris Cocuzzo 48707 by: Plutarck Re: Netscape 4.77 and PHP 48661 by: Jason Caldwell 48703 by: Jason Caldwell unregister part of array in session 48663 by: Tobias Talltorp 48675 by: Brian Clark 48679 by: Yasuo Ohgaki 48680 by: Brian Clark Re: getcwd() 48664 by: Don Read store array in a file? 48666 by: jaxon 48673 by: Brian Clark 48678 by: Brian Clark 48681 by: Juan C. Borrero Re: Oracle Connection 48667 by: Andrew Hill MySQL Data to a HTML-Form 48668 by: Denis Mettler 48676 by: Brian Clark Re: search string 48669 by: Brian Clark 48683 by: Tobias Talltorp 48684 by: dempsejn.georgetown.edu 48685 by: Brian Clark Re: test 48670 by: Brian Clark Re: limiting page for printing 48671 by: Brian Clark Re: Creating thumbnails 48672 by: Brian Clark Re: Need Feedback 48682 by: PHP General List Re: Easy News Script 48686 by: Sandeep Hundal a quick date and session id question 48687 by: Sandeep Hundal 48690 by: Maxim Maletsky 48691 by: Brian Clark 48692 by: Brian Clark 48696 by: Chris Adams Want a Good Book for Ref on PHP 48688 by: Manisha 48689 by: Kath 48693 by: Manisha 48694 by: Brian Clark 48697 by: Tyrone Mills 48698 by: Kath 48706 by: Martin Skjöldebrand MySQL Query Question 48695 by: Jeff Holzfaster 48699 by: CC Zona 48701 by: Jeff Holzfaster 48705 by: CC Zona file upload failed....:( 48700 by: JoshuaHu 48702 by: Ankur Verma fwrite not writing 48704 by: CC Zona 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] ----------------------------------------------------------------------
What to I need to do/configure in order for PHP 4 to be able to connect to Access and/or SQL Server databases? --Bob
Hi Bob, @ 2:40:21 PM on 4/15/2001, Bob Clingan wrote: > What to I need to do/configure in order for PHP 4 to be able to > connect to Access and/or SQL Server databases? http://www.php.net/manual/en/install.configure.php#install.configure.databases -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
Locally on a Win32 box, use the odbc functions built in, with a local DSN. On Unix, compile php with iodbc (http://www.iodbc.org) and use an ODBC driver to connect to the SQLServer or Access db on the Win32 box. You can use OpenLink's drivers if you like - For SQLServer: - install Multi-Tier driver from www.openlinksw.com, with client as unix and server as win box. - configure DSN in unix side odbc.ini, per the example. - test with odbctest - use odbc_connect() in your script, making sure you have specified putenv("ODBCINI=/path/to/odbc.ini"); For Access -similar to above, but unix side DSN needs to pass Database field as name of a Win32 side DSN using the native MS driver. The ServerType should also be ODBC instead of Access on the unix side. Please let me know if you require assistance. Best regards, Andrew -------------------------------------------- Andrew Hill . Director Technology Evangelism OpenLink Software . www.openlinksw.com Internet Data Integration Technology On 4/15/01 2:40 PM, "Bob Clingan" <[EMAIL PROTECTED]> wrote: > What to I need to do/configure in order for PHP 4 to be able to connect to > Access and/or SQL Server databases? > > --Bob > >
Hello Chris, On 14-Apr-01 16:07:59, you wrote: >Alright I'll start this out by saying I have a subscription to "Visual Basic >Programmers Journal". Before I converted and realized that I loved PHP so >much I used ASP. Well it seems that in this magazine that XML is a hot topic >in the MS world. I know XML can be used by PHP, but is there a point? I only >know 2 things about it: >1) You can make your own tags: > <mytag> </mytag> >2) It's supposedly good for databasing? >If its for databasing, why not just use MySQL( or a variation). Am I missing >something here? Actually XML is yet another Internet mania, pretty much like Java. Java represented the dream of some programmers of "write once run everywhere". XML represents the dream of one data/document source, many target medias (HTML, WML, PDF, etc...). The problem is that all this flexibility comes at a price, most frequently CPU time. For general Internet development this is a kind of waste, because the usual latency in deliverying information is already a problem, it gets worse if the information servers have to interpret Java programs or process XML formatted information to serve the user requests. Good sense tells that if you can serve content without going through the hops of transforming raw data (database, etc...) into XML to later transforme it into HTML, you'd better go directly from raw data to HTML or else your hardware bill will be much higher when you attempt to scale up. Now, if you mean to use XML for purposes that do not require extra processing on demand when you are serving your content, it may provide extra flexibility that may save you a lot and hand-programming. Take for instance this example. Metabase is a PHP database abstraction package that lets you develop applications that are database independent. This means that if you use Metabase you can write applications that may work seeminglessly with different databases. Just figure how much porting efforts you will save when you figure that MySQL is not enough. To help you develop fully portable applications, Metabase not only provides a database independent API, but also provides a database independent means to install and maintain database schemas. Metabase uses a custom XML format to describe database schemas: tables, fields, indexes and sequences. It comes with a parser that extracts the schema description from those XML files. Then the Metabase manager is able to install that schema by creating all the tables and sequences that are described. If someday you change your database schema, Metabase manager is also able to figure the changes and alter the schema of the previously installed database without affecting any data added to the database since the it was installed or updated for the last time. Metabase manager is also able to dump in its XML format a installed database schema along with any data stored in the database so you can install it in another database server without information loss. The use of XML in Metabase is just an example of how it can be used for a purpose that improves your development process and does not affect the ability of your applications to serve data to the users with great performance impact, like when you get when you use XML/XSL to serve data on demand. Metabase is free and is avaliable here: http://phpclasses.UpperDesign.com/browse.html/package/20 Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED] -- E-mail: [EMAIL PROTECTED] URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --
Hello Plutarck, On 14-Apr-01 17:07:42, you wrote: >I use to be really enthusiastically pro-XML just as I was getting into PHP, >but now I've basically taken a "XML shmexXML" approach. I get the initial >attraction, but I would think the love would fade off a bit. >The key that so many people seem to forget is the best way to do HTML is >with, *gasp*, HTML! Exactly! >If you just want a webpage, XML is using a canon to kill a fly. It's like >creating classes and objects in PHP for sending text emails. >Sure you can do it...but why? Maybe you miss the point of using classes and objects in general programming. Classes encapsulate behaviour and data. They are just a capsule of script functions and related data. Sending mails correctly formatted is not such a trivial job. If you write a class that encapsulates that takes you may reuse it several times without having to be reminded of the details of sending e-mails. If you don't know how to correctly send e-mails, you may reuse a class written by someone else. All you need to learn is the class API. This level of reusability has been saving many developers thousands of hours, making their projects viable to deploy. If you doubt it, you may look at the PHP Classes repository: http://phpclasses.UpperDesign.com/ There are now over 200 classes that have been used by over 30.000 of PHP programmers. Not all classes are that much useful and popular, but in particular in the top downloads page you can seen that many classes have been downloaded by many thousands of users: http://phpclasses.UpperDesign.com/browse.html/top >XML is new. Common society doesn't do well with new. They always manage to >screw it up somehow. >XML started as an extensible markup language...that's it. That's all it was >supposed to do! Now people are using it to query databases, and concoct >entire search engines, and they are trying to use it to control access to >restricted data, etc etc. >It's the same thing that happened with Java. People just aren't good with >"new". Right, like with Java, time will tell what uses of XML are viable and desirable. >XML is nice, and for some things it's even great. But it's not the death of >plain old HTML, just like ISDN didn't kill POTS (remember when ISDN was "the >future of telecom"?). >I fear that there are too many cooks in the kitchen on XML, all with a >seasoning all their own that they are dead set on adding to the broth. Yes, everybody wants to invent their own XML format! :-) >But for me, I say let people play with their Java and XML and new fangled >widgets. I'll take my PHP and plain-old HTML, and I'll create twice as much >material with just as high a quality, and I won't need to spend an extra >minute learning a bleeding-edge technology. >Life's too short to spend it learning how to live it. Translation: Better to >program than to learn yet _another_ language. ... unless using such language brings you great benefits that outweight its costs. Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED] -- E-mail: [EMAIL PROTECTED] URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --
Hello Jeff, On 14-Apr-01 21:50:21, you wrote: >Hi All, >My apologies if this is too wordy. >This is driving me nuts. I have very little experience or knowledge of PHP >and MySQL but have been put in a position that requires me to build several >applications that require me to figure them out. I am making progress, >though. Here is my first delimit: I am not sure if this solves your whole problem, but you may want to try this PHP query result table display class: http://phpclasses.UpperDesign.com/browse.html/package/130 Manuel Lemos >I have a form page that looks like this: >http://www.webtinker.com/fran_info.htm This form has several things going >on. 1st, the first pull down list needs to reflect the same info as the two >location descriptions. 2nd, the two locations "Round Table Discussion" will >grow to an unknown number of entries over time so the two may become 6 or 8 >or... My first big (for me) hurdle is to figure out how to get these to >show up at the top of this form in order of the date with the closest one >first. They need to be in the same format as they appear but with >additional rows showing as more entries are made. The ones showing can't be >past due, or, don't show past dates. >What I have figured out so far is how to populate the pull down, how to make >the admin form to fill in the needed info into the MySQL table and I have >had limited success in displaying the meeting info at the top of the form. >I just can't figure out how to make them wrap into groups of info, say with >5 entries of different meetings. Do I need a separate query for each row of >info using the limit statement in the query or is there a way to do this >using <gulp> arrays? I have just about every book available and just can't >find a good example of this type of formatted query results. How do I >approach this? >Here is the table I am using: >CREATE TABLE rnd_tbl ( > id tinyint(10) DEFAULT '0' NOT NULL auto_increment, > location varchar(100) NOT NULL, > address varchar(45) NOT NULL, > address2 varchar(45) NOT NULL, > city varchar(50) NOT NULL, > state char(2) NOT NULL, > zip varchar(14) NOT NULL, > day char(3) NOT NULL, > date varchar(25) NOT NULL, > time varchar(25) NOT NULL, > phone varchar(15) NOT NULL, > PRIMARY KEY (id) >); >Many Thanks!! >Short Circuit >-- >PHP General 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] Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED] -- E-mail: [EMAIL PROTECTED] URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --
hi everyone, i have been using perl for quite some time, but after getting used to php4, i think it rocks. i am wondering which is better, performance-wise, when trying to match the same text: PCRE or POSIX extended in php4? cheers, Bill
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (bill) wrote: > i have been using perl for quite some time, but after getting used to > php4, i think it rocks. > > i am wondering which is better, performance-wise, when trying to match the > same text: PCRE or POSIX extended in php4? PCRE. -- CC
Hello everyone, I know this has been discussed many times before. I even read the past threads in the list archives. I've written a shopping cart/catalog that uses mysql on the backend. I need to be able to accept cc orders. Is Paypal a good choice? I've never really use any service like this before. When the user orders an item, will they have to leave my website? Thanks, Tyler
I don´t have any experience in this area either, but I found this article on Php-bilder.com. It might be useful for you: http://www.phpbuilder.com/columns/matt20000305.php3 (Curl is a part of PHP now... http://www.php.net/manual/en/ref.curl.php) You might find these sections in the manual rewarding aswell: http://www.php.net/manual/en/ref.pfpro.php http://www.php.net/manual/en/ref.cybercash.php I don´t know how much they cost or anything... Anyone who knows? // Tobias Talltorp ""Tyler Longren"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello everyone, > > I know this has been discussed many times before. I even read the past > threads in the list archives. I've written a shopping cart/catalog that > uses mysql on the backend. I need to be able to accept cc orders. Is > Paypal a good choice? I've never really use any service like this before. > When the user orders an item, will they have to leave my website? > > Thanks, > Tyler > > > -- > PHP General 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 mysql question. I'm using php to list a table from mysql. I'm doing: $result=mysql_query("select * from messagem where flag=1 order by date"); But The first list of the "mysql_fetch_row($result)" is the first date. I want to start printing by the last date. But I want to know if I can do this by the mysql_query. I don't want this: $i = mysql_numrows($result); while ($i >= 0) { print mysql_result($result, $i, 'date')."<br>"; } regards, Augusto Cesar Castoldi
You can sort in descending order in your sql statement select * from messagem where flag-1 order by date desc Seung-woo Nam Augusto Cesar Castoldi wrote: > > I have a little mysql question. I'm using php to list a table from mysql. > > I'm doing: $result=mysql_query("select * from messagem where flag=1 order > by > date"); > > But The first list of the "mysql_fetch_row($result)" is the first date. I > want to start printing by the last date. > > But I want to know if I can do this by the mysql_query. I don't want this: > > $i = mysql_numrows($result); > while ($i >= 0) { > print mysql_result($result, $i, 'date')."<br>"; > } > > regards, > > Augusto Cesar Castoldi >
I've only been trying to learn this stuff for a few days and thought I was on a roll, but now have run into a problem I don't get at all. In my script I have the following sql query and am receiving the following error when it executes "You have an error in your SQL syntax near '' at line 1." Any idea what my problem is? I removed the WHERE id=$id and it works, but updates every record of course :( I'm lost here. Thanks for any help. $sql ="UPDATE members SET ". "name='$name', ". "email='$email', ". "icq='$icq', ". "password='$password', ". "loginid='$loginid', ". "countryid='$countryid', ". "gtlogin='$gtlogin', ". "gtpass='$gtpass', ". "swirvelogin='$swirvelogin', ". "swirvepass='$swirvepass' ". "WHERE id=$id" ;
What do you have in the id variable? It's contents can be the problem. regards, Augusto Cesar Castoldi On Sun, 15 Apr 2001, Scott VanCaster wrote: > I've only been trying to learn this stuff for a few days and thought I was > on a roll, but now have run into a problem I don't get at all. In my script > I have the following sql query and am receiving the following error when it > executes "You have an error in your SQL syntax near '' at line 1." > > Any idea what my problem is? I removed the WHERE id=$id and it works, but > updates every record of course :( > > I'm lost here. Thanks for any help. > > $sql ="UPDATE members SET ". > "name='$name', ". > "email='$email', ". > "icq='$icq', ". > "password='$password', ". > "loginid='$loginid', ". > "countryid='$countryid', ". > "gtlogin='$gtlogin', ". > "gtpass='$gtpass', ". > "swirvelogin='$swirvelogin', ". > "swirvepass='$swirvepass' ". > "WHERE id=$id" ; > > > > -- > PHP General 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] >
On Sun, Apr 15, 2001 at 04:20:07PM -0500, Scott VanCaster wrote: > Any idea what my problem is? I removed the WHERE id=$id and it works, but > updates every record of course :( Have you tried putting the $id in quotes too? | WHERE = '$id' if that doesn't help, print the sql-statement to STDOUT (e.g. probably to the browser) and take a look at it, that way it is easier to see where the error is. -fkr -- gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | |all your base are belong to us | shame on me | fkr@IRCnet |
id is the primary key for the table. If I add echo ($id); before the query it echos a 15, which is correct. Well, it's the right id for the test person I'm logged into the site as anyway. I'm missing something here :) "Augusto Cesar Castoldi" <[EMAIL PROTECTED]> wrote in message Pine.A41.4.32.0104151924060.11846-100000@marte">news:Pine.A41.4.32.0104151924060.11846-100000@marte... > What do you have in the id variable? > > It's contents can be the problem. > > regards, > > Augusto Cesar Castoldi > > On Sun, 15 Apr 2001, Scott VanCaster wrote: > > > I've only been trying to learn this stuff for a few days and thought I was > > on a roll, but now have run into a problem I don't get at all. In my script > > I have the following sql query and am receiving the following error when it > > executes "You have an error in your SQL syntax near '' at line 1." > > > > Any idea what my problem is? I removed the WHERE id=$id and it works, but > > updates every record of course :( > > > > I'm lost here. Thanks for any help. > > > > $sql ="UPDATE members SET ". > > "name='$name', ". > > "email='$email', ". > > "icq='$icq', ". > > "password='$password', ". > > "loginid='$loginid', ". > > "countryid='$countryid', ". > > "gtlogin='$gtlogin', ". > > "gtpass='$gtpass', ". > > "swirvelogin='$swirvelogin', ". > > "swirvepass='$swirvepass' ". > > "WHERE id=$id" ; > > > > > > > > -- > > PHP General 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 General 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 "think" I tried that. Let me go try that again to be sure. Oh, and what's STDOUT ? I'm just getting started here and haven't even seen that yet :) I can't believe how fast the responses are either. Thanks to all for helping others out so quickly :) "Felix Kronlage" <[EMAIL PROTECTED]> wrote in message 20010415232649.A11407@mad">news:20010415232649.A11407@mad... > On Sun, Apr 15, 2001 at 04:20:07PM -0500, Scott VanCaster wrote: > > > Any idea what my problem is? I removed the WHERE id=$id and it works, but > > updates every record of course :( > > Have you tried putting the $id in quotes too? > > | WHERE = '$id' > > if that doesn't help, print the sql-statement to STDOUT (e.g. probably to the > browser) and take a look at it, that way it is easier to see where the > error is. > > -fkr > -- > gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 > |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | > |all your base are belong to us | shame on me | fkr@IRCnet | > > > -- > PHP General 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 changed $id to '$id' No more error, but nothing updates. Assuming it's because with the single quotes nothing in the table matches? "Felix Kronlage" <[EMAIL PROTECTED]> wrote in message 20010415232649.A11407@mad">news:20010415232649.A11407@mad... > On Sun, Apr 15, 2001 at 04:20:07PM -0500, Scott VanCaster wrote: > > > Any idea what my problem is? I removed the WHERE id=$id and it works, but > > updates every record of course :( > > Have you tried putting the $id in quotes too? > > | WHERE = '$id' > > if that doesn't help, print the sql-statement to STDOUT (e.g. probably to the > browser) and take a look at it, that way it is easier to see where the > error is. > > -fkr > -- > gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 > |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | > |all your base are belong to us | shame on me | fkr@IRCnet | > > > -- > PHP General 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] >
Well, I added the echo($id); back in and am just getting $id printed, so it looks like I have another problem :( Now to see if I can find it and figure it out. ""Scott VanCaster"" <[EMAIL PROTECTED]> wrote in message 9bd3pv$qbd$[EMAIL PROTECTED]">news:9bd3pv$qbd$[EMAIL PROTECTED]... > id is the primary key for the table. If I add echo ($id); before the query > it echos a 15, which is correct. Well, it's the right id for the test > person I'm logged into the site as anyway. I'm missing something here :) > > > "Augusto Cesar Castoldi" <[EMAIL PROTECTED]> wrote in message > Pine.A41.4.32.0104151924060.11846-100000@marte">news:Pine.A41.4.32.0104151924060.11846-100000@marte... > > What do you have in the id variable? > > > > It's contents can be the problem. > > > > regards, > > > > Augusto Cesar Castoldi > > > > On Sun, 15 Apr 2001, Scott VanCaster wrote: > > > > > I've only been trying to learn this stuff for a few days and thought I > was > > > on a roll, but now have run into a problem I don't get at all. In my > script > > > I have the following sql query and am receiving the following error when > it > > > executes "You have an error in your SQL syntax near '' at line 1." > > > > > > Any idea what my problem is? I removed the WHERE id=$id and it works, > but > > > updates every record of course :( > > > > > > I'm lost here. Thanks for any help. > > > > > > $sql ="UPDATE members SET ". > > > "name='$name', ". > > > "email='$email', ". > > > "icq='$icq', ". > > > "password='$password', ". > > > "loginid='$loginid', ". > > > "countryid='$countryid', ". > > > "gtlogin='$gtlogin', ". > > > "gtpass='$gtpass', ". > > > "swirvelogin='$swirvelogin', ". > > > "swirvepass='$swirvepass' ". > > > "WHERE id=$id" ; > > > > > > > > > > > > -- > > > PHP General 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] et > > > > > > > > > -- > > PHP General 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 General 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 everyone, I'm an idiot :) I had the case wrong. I needed $ID, not $id !!!!! Thanks for the assistance though. Nice to know ya'll are here. Scott ""Scott VanCaster"" <[EMAIL PROTECTED]> wrote in message 9bd394$ikn$[EMAIL PROTECTED]">news:9bd394$ikn$[EMAIL PROTECTED]... > I've only been trying to learn this stuff for a few days and thought I was > on a roll, but now have run into a problem I don't get at all. In my script > I have the following sql query and am receiving the following error when it > executes "You have an error in your SQL syntax near '' at line 1." > > Any idea what my problem is? I removed the WHERE id=$id and it works, but > updates every record of course :( > > I'm lost here. Thanks for any help. > > $sql ="UPDATE members SET ". > "name='$name', ". > "email='$email', ". > "icq='$icq', ". > "password='$password', ". > "loginid='$loginid', ". > "countryid='$countryid', ". > "gtlogin='$gtlogin', ". > "gtpass='$gtpass', ". > "swirvelogin='$swirvelogin', ". > "swirvepass='$swirvepass' ". > "WHERE id=$id" ; > > > > -- > PHP General 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] >
scott, try the entire SQL statement without single quotes around those variables. except for when your setting the WHERE part. Try: $sql ="UPDATE members SET ". "name=$name, ". "email=$email, ". "icq=$icq, ". "password=$password, ". "loginid=$loginid, ". "countryid=$countryid, ". "gtlogin=$gtlogin, ". "gtpass=$gtpass, ". "swirvelogin=$swirvelogin, ". "swirvepass=$swirvepass ". "WHERE id='$id'" ; I could be wrong though, but just my two cents. chris www.variancecreations.net -----Original Message----- From: Scott VanCaster [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 15, 2001 5:20 PM To: [EMAIL PROTECTED] Subject: [PHP] SQL Query syntax error... Help? I've only been trying to learn this stuff for a few days and thought I was on a roll, but now have run into a problem I don't get at all. In my script I have the following sql query and am receiving the following error when it executes "You have an error in your SQL syntax near '' at line 1." Any idea what my problem is? I removed the WHERE id=$id and it works, but updates every record of course :( I'm lost here. Thanks for any help. $sql ="UPDATE members SET ". "name='$name', ". "email='$email', ". "icq='$icq', ". "password='$password', ". "loginid='$loginid', ". "countryid='$countryid', ". "gtlogin='$gtlogin', ". "gtpass='$gtpass', ". "swirvelogin='$swirvelogin', ". "swirvepass='$swirvepass' ". "WHERE id=$id" ; -- PHP General 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! :) -----Original Message----- From: Scott VanCaster [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 15, 2001 6:05 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] SQL Query syntax error... Help? Nevermind everyone, I'm an idiot :) I had the case wrong. I needed $ID, not $id !!!!! Thanks for the assistance though. Nice to know ya'll are here. Scott ""Scott VanCaster"" <[EMAIL PROTECTED]> wrote in message 9bd394$ikn$[EMAIL PROTECTED]">news:9bd394$ikn$[EMAIL PROTECTED]... > I've only been trying to learn this stuff for a few days and thought I was > on a roll, but now have run into a problem I don't get at all. In my script > I have the following sql query and am receiving the following error when it > executes "You have an error in your SQL syntax near '' at line 1." > > Any idea what my problem is? I removed the WHERE id=$id and it works, but > updates every record of course :( > > I'm lost here. Thanks for any help. > > $sql ="UPDATE members SET ". > "name='$name', ". > "email='$email', ". > "icq='$icq', ". > "password='$password', ". > "loginid='$loginid', ". > "countryid='$countryid', ". > "gtlogin='$gtlogin', ". > "gtpass='$gtpass', ". > "swirvelogin='$swirvelogin', ". > "swirvepass='$swirvepass' ". > "WHERE id=$id" ; > > > > -- > PHP General 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 General 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]
In the future, to make things easier on yourself, when you get a query syntax error add an "echo $sql;" line right before your query. Almost every time I have a query problem, that solves it. -- Plutarck Should be working on something... ...but forgot what it was. ""Scott VanCaster"" <[EMAIL PROTECTED]> wrote in message 9bd394$ikn$[EMAIL PROTECTED]">news:9bd394$ikn$[EMAIL PROTECTED]... > I've only been trying to learn this stuff for a few days and thought I was > on a roll, but now have run into a problem I don't get at all. In my script > I have the following sql query and am receiving the following error when it > executes "You have an error in your SQL syntax near '' at line 1." > > Any idea what my problem is? I removed the WHERE id=$id and it works, but > updates every record of course :( > > I'm lost here. Thanks for any help. > > $sql ="UPDATE members SET ". > "name='$name', ". > "email='$email', ". > "icq='$icq', ". > "password='$password', ". > "loginid='$loginid', ". > "countryid='$countryid', ". > "gtlogin='$gtlogin', ". > "gtpass='$gtpass', ". > "swirvelogin='$swirvelogin', ". > "swirvepass='$swirvepass' ". > "WHERE id=$id" ; > > > > -- > PHP General 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] >
WOW ! Thanks everyone... great responses :-) I will look at my tables... no doubt I goofed somewhere. Jason ""Jason Caldwell"" <[EMAIL PROTECTED]> wrote in message 9bbd0v$686$[EMAIL PROTECTED]">news:9bbd0v$686$[EMAIL PROTECTED]... > I've created a test.php file that dynamically loads HTML.. works totally > fine in IE 5, but when I test it with Netscape 4.77 -- nothing comes up... > just a totally blank page. > > Anyone know why this might be happening? > > Thanks. > Jason > > > > > -- > PHP General 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] >
that was it.... i was missing the closing </table> thanks ""Jason Caldwell"" <[EMAIL PROTECTED]> wrote in message 9bbd0v$686$[EMAIL PROTECTED]">news:9bbd0v$686$[EMAIL PROTECTED]... > I've created a test.php file that dynamically loads HTML.. works totally > fine in IE 5, but when I test it with Netscape 4.77 -- nothing comes up... > just a totally blank page. > > Anyone know why this might be happening? > > Thanks. > Jason > > > > > -- > PHP General 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 know how to unset a specific value in an ordinary array: unset ($array["one"]); How do I do this if my array is in a session? Here is my code: <? session_start(); $array = array(one=> "number one", two=> "Number two", three=> "Number three"); session_register("array"); ?> I tried this... Didn't work: <? session_start(); session_unregister("array[one]"); ?> Thanks, // Tobias Talltorp
Hi Tobias, @ 7:01:41 PM on 4/15/2001, Tobias Talltorp wrote: ... > I tried this... Didn't work: > <? > session_start(); > session_unregister("array[one]"); ?>> Why not save the values to a temp variable, destroy the session, unset the value you want to unset, then register it again? -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
You are registered $array as session, You need to unset() element. I think it should work. Regards, -- Yasuo Ohgaki ""Tobias Talltorp"" <[EMAIL PROTECTED]> wrote in message 9bd8un$kqt$[EMAIL PROTECTED]">news:9bd8un$kqt$[EMAIL PROTECTED]... > I know how to unset a specific value in an ordinary array: > unset ($array["one"]); > How do I do this if my array is in a session? > > Here is my code: > <? > session_start(); > $array = array(one=> "number one", two=> "Number two", three=> "Number > three"); > session_register("array"); > ?> > > I tried this... Didn't work: > <? > session_start(); > session_unregister("array[one]"); > ?> > > Thanks, > // Tobias Talltorp > > > > > -- > PHP General 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] >
@ 8:18:31 PM on 4/15/2001, Brian Clark wrote: ... > Why not save the values to a temp variable, destroy the session, > unset the value you want to unset, then register it again? Well I take that back. Read the first two comments here: http://www.php.net/manual/en/function.session-unset.php By doing what I originally suggested, I guess they'd end up with a different session, which isn't what you want obviously. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
On 15-Apr-01 kenny.hibs wrote: > Is there a php3 alternative to the getcwd() function > try: $cwd=`pwd`; -- or -- $cwd=`/bin/pwd`; Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.
Hey all, can someone make a recommendation here? I want to keep site structural info pulled from a database in an array, and store it in a flat file that can eliminate the database hit. Then I'll just delete the file when structure changes, and regenerate it with a call to a recreation script that does the necessary sql once. So - does this make sense? - how to sore the array in a flat file - any way to make the array global once loaded? Thanks for any pointers! cheers, jaxon
Hi jaxon, @ 7:32:10 PM on 4/15/2001, jaxon wrote: ... > I want to keep site structural info pulled from a database in an > array, and store it in a flat file that can eliminate the database > hit. Then you'll be hitting the disk too (really, either way), but I doubt that's going to speed it up very much. > Then I'll just delete the file when structure changes, and regenerate it > with a call to a recreation script that does the necessary sql once. > So > - does this make sense? No, I'm lost. > - how to sore the array in a flat file One way is to implode() the data from an array into a single line (separated by whatever you wish), then write the line to the file on disk. http://www.php.net/manual/en/function.implode.php > - any way to make the array global once loaded? By using global? http://www.php.net/manual/it/language.variables.scope.php -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
@ 8:12:51 PM on 4/15/2001, Brian Clark wrote: ... > http://www.php.net/manual/it/language.variables.scope.php Oops. replace 'it' with 'en' -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
The info pulled from a Database (Mysql) is already stored in an array, then you can move the pointer back and forward when you need it. You can send it to the first "record" and re read it several times... with mysql_data_seek ($result, 0); goes to the first record again. JuanCaBo ----- Original Message ----- From: "jaxon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, April 15, 2001 6:32 PM Subject: [PHP] store array in a file? > > Hey all, can someone make a recommendation here? > > I want to keep site structural info pulled from a database in an array, and > store it in a flat file that can eliminate the database hit. > > Then I'll just delete the file when structure changes, and regenerate it > with a call to a recreation script that does the necessary sql once. > > So > - does this make sense? > - how to sore the array in a flat file > - any way to make the array global once loaded? > > Thanks for any pointers! > > cheers, > jaxon > > > -- > PHP General 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 can use ODBC as well. Compile PHP with iODBC (http://www.iodbc.org) and you can use an ODBC driver instead of the oci - this can bypass the Oracle client install in many cases. Best regards, Andrew -------------------------------------------- Andrew Hill . Director Technology Evangelism OpenLink Software . www.openlinksw.com Internet Data Integration Technology On 4/10/01 11:53 AM, "Brian S. Dunworth" <[EMAIL PROTECTED]> wrote: > At 08:42 AM 4/10/01 -0700, Dunaway, Brian wrote: > >> I need to access a remote oracle database. What I mean is that the machine >> that is allowed access to the oracle database is not running php...I have >> access to the machine with the oracle access from my machine which is >> running php. Boy that sounds confusing. > > No, not really. > >> anyway I am setting my environment with putenv(oracle_home=/something) and >> putenv(oracle_sid=database)...what can I do? any ideas? > > I'm assuming that this isn't working for you. Make sure you set > NLS_LANG etc, as well in your environment, as specified in the PHP > documentation. > > Do you have an Oracle client installed on the machine that has PHP > installed on it? Did you compile PHP with oci8 support? > > Here, our web server (Linux) has Apache/PHP and Oracle Net8 client > installed. The Net8 client talks to our Sun box with Oracle 8i > installed. Works with PHP with no hitches. > >> Brian D. > > yeah, me too. :) > >> Running PHP 4 > > yeah, me too. :) > > - Brian > > ------------------------------------- > Brian S. Dunworth > Sr. Software Development Engineer > Oracle Database Administrator > The Printing House, Ltd. > > (850) 875-1500 x225 > <[EMAIL PROTECTED]> > ------------------------------------- >
Hi, I got Data from my Database, but how can I show them in a textfiled within a html form? Any ideas? Thanks in advance. -- Best Regards Denis
Hi Denis, @ 8:13:41 PM on 4/15/2001, Denis Mettler wrote: > I got Data from my Database, but how can I show them in a textfiled > within a html form? Any ideas? Show us some code? Assuming you've gotten the data into a $row->column, just echo it into the value of one of the form fields: <input type="text" name="foo" value="<?php echo $row->column; ?>" /> -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
Hi Joseph, @ 12:08:46 PM on 4/15/2001, Joseph Bannon wrote: > What is the function to search a string? Basically, I want search a string > (a url) to see if it has "www.yahoo.com" in it and if yes, tell the user > their submission cannot be accepted. <?php $string = 'www.yahoo.com'; print(strstr($string,'yahoo.com') ? 'Failed.' : 'Passes'); ?> -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
I think you want regular expressions... Try this on for size: $str = "http://www.yahoo.com/somedir/somepage.html"; if (preg_match("/www.yahoo.com/i", $str)) { print "Your submission cannot be accepted"; } else { print "You are good"; } If you want to read up on regular expressions: http://www.php.net/manual/en/ref.pcre.php (Faster than ereg) http://www.php.net/manual/en/ref.regex.php // Tobias Talltorp ""Joseph Bannon"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > What is the function to search a string? Basically, I want search a string > (a url) to see if it has "www.yahoo.com" in it and if yes, tell the user > their submission cannot be accepted. > > J > > > > > -- > PHP General 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] >
Even better, try strstr...it'll be faster than a regexp for a simple search of a string for another string. -jack ----- Original Message ----- From: "Tobias Talltorp" <[EMAIL PROTECTED]> Date: Sunday, April 15, 2001 7:20 pm Subject: Re: [PHP] search string > I think you want regular expressions... > > Try this on for size: > $str = "http://www.yahoo.com/somedir/somepage.html"; > > if (preg_match("/www.yahoo.com/i", $str)) { > print "Your submission cannot be accepted"; > } else { > print "You are good"; > } > > If you want to read up on regular expressions: > http://www.php.net/manual/en/ref.pcre.php (Faster than ereg) > http://www.php.net/manual/en/ref.regex.php > > // Tobias Talltorp > > > ""Joseph Bannon"" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > What is the function to search a string? Basically, I want > search a string > > (a url) to see if it has "www.yahoo.com" in it and if yes, tell > the user > > their submission cannot be accepted. > > > > J > > > > > > > > > > -- > > PHP General 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: php-list- > [EMAIL PROTECTED]> > > > > -- > PHP General 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: php-list- > [EMAIL PROTECTED] >
Hi Tobias, @ 7:20:00 PM on 4/15/2001, Tobias Talltorp wrote: > I think you want regular expressions... > Try this on for size: > $str = "http://www.yahoo.com/somedir/somepage.html"; > if (preg_match("/www.yahoo.com/i", $str)) { > print "Your submission cannot be accepted"; > } else { > print "You are good"; > } ... I doubt there is a need to use regular expressions just to find out of a string has yahoo.com in it. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
Hi George, @ 7:19:12 PM on 4/15/2001, george wrote: ... > User-Agent: MT-NewsWatcher/3.1 (PPC) > Subject: [PHP] test > Just a test Use news://alt.test next time, please. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
Hi Fabian, @ 11:47:22 PM on 4/14/2001, Fabian Fabela wrote: ... > I have a page with a lot of data, all of this data is formated in > that page to be printed, in a table with 500 px width, but how can I > messure the length of the page with my results, for example a query > can give me exactly the height of the page, but other queries can > give me more of the height of the page and the results are cutted at > the end when I send the page to the printer. > How can I solve this problem? I don't think you can. Are you not getting the rest of the material on the next half of the second sheet or something? I don't understand what you're saying here. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
Hi Lauri, @ 11:55:51 AM on 4/15/2001, Lauri Vain wrote: ... > I just finished reading a message from the server root and I have > been told that the server I have to work with by our current project > doesn't support GD and they can't install it neither. > We will, however, need to create thumbnails from larger images > (JPEG). Are there any other solutions that don't require installing? > Some CGI scripts or something similar perhaps? ... > Our main scripting language will be PHP and the database will be > some form of SQL. Ask your sysadmin if the server has ImageMagick or NetPBM installed. You can use either of those to create thumbnails using system(). -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
Hi all, Thanks for the feedback and based on what I read, I will be keeping the sites up for at least a few more months. I would like to see decent use of the site so tell people about them. That will be my determinining factor when I rethink the sites in June or July. They are free and do not require one to be a list member to read or respond to the author. You must be a list member to post to the list, though. Thanks again to those that wrote me and enjoy. David Fordham ---------- Original Message ---------------------------------- >Hi all, > >I have had this website that captures the list email messages and placed it into a >searchable db. I did this as a learning exercise and think it is pretty cool but am wondering if I should just shut em down. > >Take a look and if I get enough feedback, I will keep them running for at least a few >more months. I have a PHP and a MYSQL list db, here are the URLs: > >http://www.summittech.com/mysqlmail.php3 >http://www.summittech.com/phpgenmail.php3 > >They are free and I am not doing anything with the data. > >Let me know, > >David Fordham >
i wrote one a few months back, and use it as a diary. the enhanced one out for release soon will look more like the slashdot system, but much easier. http://www.wde.org/php/ /sunny --- Chris Anderson <[EMAIL PROTECTED]> wrote: > I prefer to write my own > ----- Original Message ----- > From: "Zeus" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, April 12, 2001 10:11 AM > Subject: [PHP] Easy News Script > > > I'm sure many of you heard of newsphp ? (the newspro-clone). > > Somehow I felt attached to it except that it doesn't use databases > for its > file storing. > > Does anyone know a good similar script (easy to setup) that uses > mySQL? > > > > > -- > PHP General 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] > ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie
Hi all, I got two small questions. I'm trying to make an events calendar for my site, in which I want people to input in future dates, and then have the database display events by date. NOw they will probably be given a form which allows them to choose, and then gets inputted into the datase as a number : YYYYMMDD. But I want to display the data as "Monday, 20 April 2001. How can I do this? Or should I change the way I input data?? Secondly, Anyone know fof a good tutorial explaining what sessionid's in php are for and how to use them?? TIA! /sunny ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie
Hi, All you need is to insert the data into the database as YYYYMMDD and then pull it out reformatting it with mySQL functions: SELECT DATE_FORMAT(date, "%W, %e %M %Y") AS date FROM table ; this will return you the date in "Monday, 20 April 2001" format Consult with mySQL (or other SQL DB) manuals searching for DATE_FORMAT. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -----Original Message----- From: Sandeep Hundal [mailto:[EMAIL PROTECTED]] Sent: Monday, April 16, 2001 11:33 AM To: php Subject: [PHP] a quick date and session id question Hi all, I got two small questions. I'm trying to make an events calendar for my site, in which I want people to input in future dates, and then have the database display events by date. NOw they will probably be given a form which allows them to choose, and then gets inputted into the datase as a number : YYYYMMDD. But I want to display the data as "Monday, 20 April 2001. How can I do this? Or should I change the way I input data?? Secondly, Anyone know fof a good tutorial explaining what sessionid's in php are for and how to use them?? TIA! /sunny ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie -- PHP General 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]
Hi Sandeep, @ 10:33:16 PM on 4/15/2001, Sandeep Hundal wrote: ... > NOw they will probably be given a form which allows them to choose, > and then gets inputted into the datase as a number : YYYYMMDD. But I > want to display the data as "Monday, 20 April 2001. How can I do > this? Yes, with strtotime(): <?php function decipherDate($string, $format) { if(!$formatted = @date($format, strtotime($string))) return 'Unable to understand decipher date string.'; return $formatted; } /* Sunday, April 15 20001 */ print decipherDate('20010415',"l, j F Y"); print "\n"; /* 'Unable to understand decipher date string. */ print decipherDate('thisisgarbage234',"l, j F Y"); print "\n"; /* Tuesday, 8 March 2005 */ print decipherDate('march 8, 2005',"l, j F Y"); ?> ... > Secondly, Anyone know fof a good tutorial explaining what sessionid's > in php are for and how to use them?? Try here: <http://www.phpbuilder.com/columns/mattias20000105.php3> -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
@ 10:56:48 PM on 4/15/2001, Brian Clark wrote: ... > function decipherDate($string, $format) > { Oops, you'll probably want to give $format a default value if one isn't passed. And maybe change the returns if you want to do something like: if(!decipherDate('blah')) ... > if(!$formatted = @date($format, strtotime($string))) > return 'Unable to understand decipher date string.'; > return $formatted; > } > /* Sunday, April 15 20001 */ > print decipherDate('20010415',"l, j F Y"); > print "\n"; > /* 'Unable to understand decipher date string. */ I may be dyslexic or something, I'm not sure. > print decipherDate('thisisgarbage234',"l, j F Y"); > print "\n"; > /* Tuesday, 8 March 2005 */ > print decipherDate('march 8, 2005',"l, j F Y"); > ?> -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
On 15 Apr 2001 19:31:30 -0700, Sandeep Hundal <[EMAIL PROTECTED]> wrote: >NOw they will probably be given a form which allows them to choose, >and then gets inputted into the datase as a number : YYYYMMDD. But I Use mktime() to convert the entered time into a Unix timestamp and then use date() to format it.
Hi all, I am just entering into PHP world. First what I did is, I signed for PHP mailing list. I want to buy a good PHP book for my initial start and may be later on as a reference. I know there are lot in the market. Can anybody suggest a good book among them ? manisha
Professional PHP Programming: http://www.amazon.com/exec/obidos/ASIN/1861002963/qid=987388364/sr=1-12/ref= sc_b_13/002-2263539-0333643 PHP Fast & Easy Web Development: http://www.amazon.com/exec/obidos/ASIN/076153055X/qid=987388364/sr=1-9/ref=s c_b_10/002-2263539-0333643 I started with these books and STILL refer to them today. - Kath ----- Original Message ----- From: "Manisha" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, April 15, 2001 10:46 PM Subject: [PHP] Want a Good Book for Ref on PHP > Hi all, > > I am just entering into PHP world. First what I did is, I signed for PHP > mailing list. > > I want to buy a good PHP book for my initial start and may be later on as a > reference. I know there are lot in the market. Can anybody suggest a good > book among them ? > > manisha > > > -- > PHP General 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] >
Whether these books cover PHP 4 also ? manisha At 10:54 PM 4/15/01 -0400, Kath wrote: >Professional PHP Programming: >http://www.amazon.com/exec/obidos/ASIN/1861002963/qid=987388364/sr=1-12/ref= >sc_b_13/002-2263539-0333643 > >PHP Fast & Easy Web Development: >http://www.amazon.com/exec/obidos/ASIN/076153055X/qid=987388364/sr=1-9/ref=s >c_b_10/002-2263539-0333643 > >I started with these books and STILL refer to them today. > >- Kath > >----- Original Message ----- >From: "Manisha" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Sunday, April 15, 2001 10:46 PM >Subject: [PHP] Want a Good Book for Ref on PHP > > > > Hi all, > > > > I am just entering into PHP world. First what I did is, I signed for PHP > > mailing list. > > > > I want to buy a good PHP book for my initial start and may be later on as >a > > reference. I know there are lot in the market. Can anybody suggest a good > > book among them ? > > > > manisha > > > > > > -- > > PHP General 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] > >
Hi Kath, @ 10:54:03 PM on 4/15/2001, Kath wrote: > Professional PHP Programming: ... > PHP Fast & Easy Web Development: ... > I started with these books and STILL refer to them today. A good one to add to your collection would be _PHP Developer's Cookbook_ ISBN: 0672319241 Though it's not something that teaches PHP from the ground up, it's one of the best PHP books that I own. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.
Hi Manisha I use and recommend Beginning PHP 4, published by WROX and PHP Developer's Cookbook, published by SAMS. I started with the Beginning PHP 4 book, the PHP Manual, this list and phpbuilder.com. That was all I needed to get a good introduction and grounding into PHP programming. The PHP Developer's Cookbook just takes it all to the next level and gives me useable examples to real world problems. Enjoy, Tyrone -----Original Message----- From: Brian Clark [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 15, 2001 8:12 PM To: PHP is not a drug. Subject: Re: [PHP] Want a Good Book for Ref on PHP Hi Kath, @ 10:54:03 PM on 4/15/2001, Kath wrote: > Professional PHP Programming: ... > PHP Fast & Easy Web Development: ... > I started with these books and STILL refer to them today. A good one to add to your collection would be _PHP Developer's Cookbook_ ISBN: 0672319241 Though it's not something that teaches PHP from the ground up, it's one of the best PHP books that I own. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General 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]
Yes, they do. - Kath ----- Original Message ----- From: "Manisha" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, April 15, 2001 11:11 PM Subject: Re: [PHP] Want a Good Book for Ref on PHP > Whether these books cover PHP 4 also ? > > manisha > > At 10:54 PM 4/15/01 -0400, Kath wrote: > >Professional PHP Programming: > >http://www.amazon.com/exec/obidos/ASIN/1861002963/qid=987388364/sr=1-12/ref = > >sc_b_13/002-2263539-0333643 > > > >PHP Fast & Easy Web Development: > >http://www.amazon.com/exec/obidos/ASIN/076153055X/qid=987388364/sr=1-9/ref= s > >c_b_10/002-2263539-0333643 > > > >I started with these books and STILL refer to them today. > > > >- Kath > > > >----- Original Message ----- > >From: "Manisha" <[EMAIL PROTECTED]> > >To: <[EMAIL PROTECTED]> > >Sent: Sunday, April 15, 2001 10:46 PM > >Subject: [PHP] Want a Good Book for Ref on PHP > > > > > > > Hi all, > > > > > > I am just entering into PHP world. First what I did is, I signed for PHP > > > mailing list. > > > > > > I want to buy a good PHP book for my initial start and may be later on as > >a > > > reference. I know there are lot in the market. Can anybody suggest a good > > > book among them ? > > > > > > manisha > > > > > > > > > -- > > > PHP General 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 General 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] >
Kath wrote: > Professional PHP Programming: > http://www.amazon.com/exec/obidos/ASIN/1861002963/qid=987388364/sr=1-12/ref= > sc_b_13/002-2263539-0333643 I've got Beginning PHP 4 (recommended) on the back cover of which it says that the next book could be "Professional PHP Programming.". However from what I saw in the book shop they cover lots of the same ground. I (and my employer) wouldn't like to pay for the same stuff again. Is there a significant difference between the two? Martin S.
Hi, I have a couple questions... first, is there a notable MySQL General List like this one? Second, how do you write this query properly, or can it be done? select concat(date_format(date, "%W, %e %M %Y")," ",time) as date from TABLE order by date DESC; Thanks! Jeff
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Jeff Holzfaster") wrote: > I have a couple questions... first, is there a notable MySQL General List > like this one? Yes. The list on mysql.com is quite active and, like this one, it's common to get responses directly from one of the developers. (Another similarity: the MySQL list is also archived at marc.theaimesgroup.com) The most notable difference is that AFAIK there is no official news mirror of the MySQL list as there is for the PHP.net lists. Darn it. > Second, how do you write this query properly, or can it be done? > > select concat(date_format(date, "%W, %e %M %Y")," ",time) as date from TABLE > order by date DESC; The MySQL manual has a chapter on date/time fuctions. Or is it the 'order by' clause that's giving you trouble...? I assume that 'date' is a reserved word, so it may be confusing mysql. In which case, try using a different alias, like 'f_date". -- CC
> The MySQL manual has a chapter on date/time factions. Or is it > the 'order > by' clause that's giving you trouble...? I assume that 'date' is a > reserved word, so it may be confusing mysql. In which case, try using a > different alias, like 'f_date". This works: select date_format(date, "%W, %e %M %Y") as date from table This doesn't: select concat(date_format(date, "%W, %e %M %Y")," ",time) as time_of_day I'm wondering if it is possible to use concat in this way and how if it is possible. Maybe this is a question better suited for the MySQL list. Thanks! Jeff
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Jeff Holzfaster") wrote: > This works: select date_format(date, "%W, %e %M %Y") as date from table > This doesn't: select concat(date_format(date, "%W, %e %M %Y")," ",time) as > time_of_day > > I'm wondering if it is possible to use concat in this way and how if it is > possible. Maybe this is a question better suited for the MySQL list. Yu'huh. <g> Questions about making MySQL do stuff --> MySQL list Questions about making PHP do stuff --> PHP lists Questions about making PHP & MySQL play nice with each other...it's a judgement call. IMO, the PHP-DB list is the best (certainly the most thematically appropriate) place for PHP/MySQL integration issues, but YMMV. -- CC
I use PHP 4.04p11 on Apache. But my upload.php can't work... f1 is the name of file-upload-variable.... <?php if (copy($f1,"upload.txt")) { echo "<b>Upload successfully"; $fname=substring (strrchr($f1_name,"\"),1); } unlink ($f1); ?> The browser returns Parse error: parse error in c:/inetpub/php_root/upload.php on line 8 Can anyone tell me where I make mistake... thanks a lot....
try <?php if (copy($f1,"upload.txt")) { echo "<b>Upload successfully"; $fname=substring (strrchr($f1_name,"\\"),1); } unlink ($f1); ?> also the substring() function does not exist until unless you have written it yourself for the code. The standard function is substr(). hope that helps regards Ankur Verma New Delhi India -----Original Message----- From: JoshuaHu [mailto:[EMAIL PROTECTED]] Sent: Monday, April 16, 2001 9:28 AM To: [EMAIL PROTECTED] Subject: [PHP] file upload failed....:( I use PHP 4.04p11 on Apache. But my upload.php can't work... f1 is the name of file-upload-variable.... <?php if (copy($f1,"upload.txt")) { echo "<b>Upload successfully"; $fname=substring (strrchr($f1_name,"\"),1); } unlink ($f1); ?> The browser returns Parse error: parse error in c:/inetpub/php_root/upload.php on line 8 Can anyone tell me where I make mistake... thanks a lot.... -- PHP General 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]
This function suddenly stopped working, and I just can't seem to figure out why. The only change made recently is that now the value of $force at calltime is sometimes true instead of being undefined or null. build_file("file_content","/path/to/file.inc","w",TRUE); function build_file($func_name,$filepath,$mode="w",$force=FALSE) { if($force or !file_exists($filepath) or !filesize($filepath)) //echo filesize($filepath) shows '0' { $content=$func_name(); //echo $content shows it's all there $fp=fopen($filepath,$mode); fwrite($fp,$content); rewind($fp); #temp test $read_back=fread($fp,100000); #temp test echo "<p>file content:</p>\n $read_back"; #temp test, displays nothing fclose($fp); } } I've tried putting echoes and "or die('Error on __LINE__')" on every line, checked all the variable values, and found no answers from that. Everything shows exactly as it should be except that the content that echoes out so nicely *doesn't ever get written to the file*. The function runs to the end without error and the file's modification date is even updated. But the file remains empty. I'm probably missing something ridiculously obvious, but would someone please be kind enough to point out what it is? Thank you!! -- CC