RE: [PHP-DB] Fixed Quote Marks in Inputs
I just read your thread and I have to say that I was intrigued both by the subject (which is interesting) and by the different views you show. I just have one question for Jonathan : If you store the ' and as #039; and #034; what do you do if you need to show the data later on in a non HTML format (text file for example). Wouldn't you still need to convert back to ' and before you show the text? Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 05, 2002 1:44 AM To: Jonathan Hilgeman Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP-DB] Fixed Quote Marks in Inputs Ok, seems like I misjudged you and I apologize for that. I haven't changed my opinion about the very issue we've been discussing - only wanted to post the sentence above, just for the record. Bogdan Jonathan Hilgeman wrote: Apparently, the experienced way is to store them with slashes, which is what I've followed for years. I consider years of programming to be a fair amount of experience, thus qualifying me to be experienced. ANYHOW, after finally thinking a bit outside the box and with some valuable input from some co-workers, we came up with this function which is a much more efficient solution in this matter than the experienced way you proposed. My purpose in even posting this function was so that other people could avoid having to go through the same problems I faced when using the proper and apparently experienced method that I only used because I listened to programmers like you (mind you, I said LIKE you, not YOU) who believe in standard procedure in all cases without considering more efficient options. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] hiding blank MySQL results?
Hi. I have a PHP page calling a set of results from a MySQL database. They appear in the following format on the results page: Title Description Link Problem I'm having. When a db record has an empty field (for example, no description), the results page leaves a gap where the description should be. How do I do a hide if empty thang to stop the gaps appearing? Really appreciate the help. Regards nathon [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: hiding blank MySQL results?
please give us some more code to help you. -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com Nathon Jones [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi. I have a PHP page calling a set of results from a MySQL database. They appear in the following format on the results page: Title Description Link Problem I'm having. When a db record has an empty field (for example, no description), the results page leaves a gap where the description should be. How do I do a hide if empty thang to stop the gaps appearing? Really appreciate the help. Regards nathon [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Re: Array not supported for strings???
On Saturday 05 January 2002 04:24, Andy wrote: Here is the full code: ### # Get the name of the country: if (isset($country_id)){ //only if there are results for($i=0; $i count($country_id); $i++){ $stmt= SELECT country from $DB2.$geo_T1 where country_code = '$country_id[$i]' ; if ( !($result = execute_stmt($stmt, $link) )){ HEADER(Location:empty); } while ($row = mysql_fetch_object($result)){ //$country[] = $row-country; }; }; }; ### Andy [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi there, I have a problem with an array: This code: $country[] = $row-country; Creates following error msg: Fatal error: [] operator not supported for strings The wired thing is, that the same procedure works through my whole application, but not in this case. Did anybody make the same experience? You've probably used $country before in a string context. Just reset it to some known state before your while loop: unset($country); OR $country=; should do the trick. hth -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* I'd love to go out with you, but I'm converting my calendar watch from Julian to Gregorian. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] hiding blank MySQL results?
ok i get your point. how about ? while($myrow=MySQL_fetch_array($result)) { $title=$myrow[title]; $discription=$myrow[discription]; $link=$myrow[link]; if ($title !=){ $title1=$titlebr; } if ($discription !=){ $discription1=$discriptionbr; } if ($link !=){ $link1=$linkbr; } echo $title1 $discription1 $link1; ? the != means if does not equal. so basically that should i think do. if the title does not equal nothing then add a br to the end of it. (putting the return in html). So if it does equal nothing. then it will be nothing. does this make sense ? i wasnt sure on how to add br to the end... i had a shot @ it. this code may not work just an idea. Neil - Original Message - From: Nathon Jones [EMAIL PROTECTED] To: 'Shooter' [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 4:01 AM Subject: RE: [PHP-DB] hiding blank MySQL results? Thanks Neil. Does this produce a message saying Sorry no Result if the field is empty? What I am after is for it to just remain blank without inserting a blank line where the field should be and without inserting an error message. Lets say my results are as follows: Blues Magazine -- Title Best Blues Magazine in the world. -- Description www.bluesmagazine.com -- Link If one of my database records doesn't have a Description, how do I stop the PHP page inserting a blank line where the description SHOULD have been? Do you get my drift? Like, for certain records it might display: Blues Magazine blank line www.bluesmagazines.com ...where there is no description for this record. Can't get my head around it! Thanks for your help Neil. Much appreciated. Regards Nathon Jones -Original Message- From: Shooter [mailto:[EMAIL PROTECTED]] Sent: 05 January 2002 05:25 To: Nathon Jones; [EMAIL PROTECTED] Subject: Re: [PHP-DB] hiding blank MySQL results? i would suggest in your while you do someting like this while($myrow=MySQL_fetch_array($result)) { $time=$myrow[time]; if ($time ==) {$time =Sorry No Result; } echo $time; if u get my drift ? ? Nei;l - Original Message - From: Nathon Jones [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 04, 2002 5:12 PM Subject: [PHP-DB] hiding blank MySQL results? Hi. I have a PHP page calling a set of results from a MySQL database. They appear in the following format on the results page: Title Description Link Problem I'm having. When a db record has an empty field (for example, no description), the results page leaves a gap where the description should be. How do I do a hide if empty thang to stop the gaps appearing? Really appreciate the help. Regards nathon [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Subscription
Confirm my subscription Do You Yahoo!? Send a newsletter, share photos files, conduct polls, organize chat events. Visit http://in.groups.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] hiding blank MySQL results?
On Sat, 5 Jan 2002 01:12:21 - Nathon Jones Nathon Jones [EMAIL PROTECTED] wrote: Hi. I have a PHP page calling a set of results from a MySQL database. They appear in the following format on the results page: Title Description Link Problem I'm having. When a db record has an empty field (for example, no description), the results page leaves a gap where the description should be. How do I do a hide if empty thang to stop the gaps appearing? Really appreciate the help. Regards nathon [EMAIL PROTECTED] When I do something like that, I test the results before displaying the page or the page section. Use your PHP to check the results. If empty, then don't display. -- Raquel Rarely do we find men who willingly engage in hard, solid thinking. There is an almost universal quest for easy answers and half-baked solutions. Nothing pains some people more than having to think. --Martin Luther King, Jr. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] dates in db
i have a date in my mysql database in the format of 20011201 how do I output that to show for example 01 December 2001 or something similar? Cheers Adam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] dates in db
Try something like: date_format(news_date, '%d %M %Y @ %H:%I:%S') Go to http://www.mysql.com/doc/D/a/Date_and_time_functions.html and look for date_format to determine what parameters to use in order to format the date as you want it. Note that this method will actually format the date returned in your SQL statement and does not require any PHP functions, though PHP will do this to. In most situations I do it using the MySQL function because it uses one less call to format the date. [Romans 10:14) How then shall they call on him in whom they have not believed? and how shall they believe in him of whom they have not heard? and how shall they hear without a preacher? - Original Message - From: Adam Jackson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 8:28 PM Subject: [PHP-DB] dates in db i have a date in my mysql database in the format of 20011201 how do I output that to show for example 01 December 2001 or something similar? Cheers Adam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Building a user preference site
Hello, I am trying to figure out how to setup a user preference system. When the user successfully logs in they will go to a page that will display their preferences. I have a Mysql database that contains all the user info. How do I START developing a site like this. Thanks, Dan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Building a user preference site
use either sessions or cookies. ur choice. look @ the manual on both. Neil - Original Message - From: Danny Kelly [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 6:42 PM Subject: [PHP-DB] Building a user preference site Hello, I am trying to figure out how to setup a user preference system. When the user successfully logs in they will go to a page that will display their preferences. I have a Mysql database that contains all the user info. How do I START developing a site like this. Thanks, Dan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Building a user preference site
I am trying to figure out how to setup a user preference system. When the user successfully logs in they will go to a page that will display their preferences. I have a Mysql database that contains all the user info. How do I START developing a site like this. Thanks, Dan What I find usually works is this. 1. User logs in and a session variable is set indicating who is currently logged in. 2. When the user requests a page, gather together the default settings 3. Look up the users preferences in the MySQL database and merge them in to the default settings (that way you can add additional preference settings later without breaking your code) 4. Display the page using the merged setting. If no one is logged in the skip step 3 so they see the default settings. When the user changes their preferences save the changes to the database. That will allow them to log in from anywhere and retrieve their preferences. Don't trying using cookies to store preferences unless you want the preferences to apply to that browser (rather than user). Anyone using a shared machine will get very annoyed and the preferences won't be portable. Saving preferences in session also won't work because they will only last as long as the session. Loading user preferences in to session variables when the user logs in is ok and you may want to look at that. Rich -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]