[PHP] PHP Problem or MySQL (Match ... against)?

2002-12-02 Thread jtjohnston
I'm stuck. I have been to the MySQL lists for this. Now I'm reconsidering my PHP code. http://ccl.flsh.usherb.ca/print/display.table.inc.phps I just don't know where I'm going wrong anymore. If I run this SQL in PHPMyAdmin, it works. jdaxell.ccl should have one entry for "ready maria". SELECT i

Re: [PHP] PHP Problem or MySQL (Match ... against)?

2002-12-02 Thread jtjohnston
Chris, or anyone, I have tried to escape the slashes. Debugging ... $sql = 'SELECT ... ... AGAINST (\'"ready maria"\' IN BOOLEAN MODE) ...'; This works. But if I addslashes or stripslashes, or do nothing, it does not work. See these 3 variations. Neither work. What should I do? A part from hang

[PHP] Quickie array question

2003-06-11 Thread jtjohnston
foreach($newlines as $newline) { #how do I get the index of the array each time $newline is printed out? echo ??; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] 4 hours staring - can't see clear.

2003-06-11 Thread jtjohnston
Can someone see clearly through what I'm trying to do please? I've been at this for 4 hours trying to see where I have gone wrong. # contents of a text file # Enregistrement TI: ... So They Understand ...: Cultural Issues AU: Schneider,-William PB: Logan, UT : Utah

[PHP] \nhelp

2001-05-16 Thread jtjohnston
Hi, I am parsing the contents of a text file. I have certain lines that start with "&&4;" I would like to attach these lines to the previous line as follows. But I don't know how. I figure I have to search and replace for "\n&&4;" but ... ? BEFORE: Here is an example of before. &&4; here is the

[PHP]

2002-01-18 Thread jtjohnston
This is the input of a . I don't suppose there is an easier way of doing this? $mydata->KW = str_replace("\r", "", $mydata->KW); $mydata->KW = str_replace("\n", "", $mydata->KW); $mydata->KW = str_replace("", "", $mydata->KW); What does htmlspecialchars do exactly? Yes I've read the docs, but di

[PHP] How? :)

2002-01-29 Thread jtjohnston
Let's say I have two fields TNum and AU. TNum is a BritishAmericanCanadian AU name of an author. I want to sort them as follows. British Shakespeare American Joyce Samuels Twain Canadian Majors

Re: [PHP] How? :)

2002-01-29 Thread jtjohnston
uot;".$mydata->TNum.":"; > } > $body .= "".$mydata->AU.""; > } > ------ > > tada!! > > Martin > > -Original Message- > From: jtjohnston [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 30, 2002 2:05 PM >

[PHP] Martin: [PHP] How? :)

2002-01-29 Thread jtjohnston
$mydata->TNum; > $body .= "".$mydata->TNum.":"; > } > $body .= "".$mydata->AU.""; > } > ------ > > tada!! > > Martin > > -Original Message---

[PHP] .

2002-01-30 Thread jtjohnston
. -- 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] Forcing close of thread

2002-01-30 Thread jtjohnston
I have read the FAQ http://www.php.net/manual/en/function.mysql-close.php This might even be a mysql question, but I could really use some advice from people using php scripts to access mysql. I have been getting a lot of this on my windows/mysql server: 020130 16:11:08 C:\PROGRA~1\EASYPHP\MySq

Re: [PHP] .

2002-01-30 Thread jtjohnston
Towell wrote: > sure about that ? > > -Original Message- > From: jtjohnston [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 31, 2002 2:10 PM > To: [EMAIL PROTECTED] > Subject: [PHP] . > > . > > -- > PHP General Mailing List (http://www.php.net/) > T

[PHP] Forcing close of thread

2002-01-30 Thread jtjohnston
I'm having growing pains with my mysql server (Windows). I get a lot of "Forcing close of thread ..." Do I need to add mysql_close() to the end of everything? I never had to before on a Unix mysql server. Is "mysql_close($myconnection);" correct? Is it necessary? $myconnection = mysql_pconnect($

[PHP] mysql_pconnect & mysql_connect

2002-01-30 Thread jtjohnston
What is the difference between: $myconnection = mysql_connect($server,$user,$pass); and $myconnection = mysql_pconnect($server,$user,$pass); I read the faq. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Re: [PHP] mysql_pconnect & mysql_connect

2002-01-30 Thread jtjohnston
be persistent only until the script finishes, but I can prove otherwise. A windows thing? Who knows? John Jeff Sheltren wrote: > At 11:09 PM 1/2/2002 -0500, jtjohnston wrote: > >What is the difference between: > > > >$myconnection = mysql_connect($server,$user,$pass); >

Re: [PHP] mysql_pconnect & mysql_connect

2002-01-30 Thread jtjohnston
Actually, from what I understand, with the persistent connection, it is left open even after the script is finished - that's why it's called persistent. Jeff, (Not Jim :) - it's getting way late for my tired eyes :) Sorry. Thanks. I suppose I had to read it one more time. That at least makes sen

[PHP] limit 0,30

2002-01-31 Thread jtjohnston
I want to do something like this on a page: Pages: 1 2 3 [Next>>] How can I code SELECT * FROM `bookmarks` LIMIT 0, 30 ? Thanks? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact th

[PHP] Anyone Up?

2002-01-31 Thread jtjohnston
Anyone Awake? Up? I'm using 12 checkboxes dynamically generated by mysql. Each has an id as primary index so I do this: id."\" VALUE=\"".$mydata->yourname."\"> When I submit, I want to echo to see if anyone clicked on them. But I can't get my variable right to find $check1 through $check12.

[PHP] Re: Anyone Up?

2002-01-31 Thread jtjohnston
lt;= $NMax; $i++) { #$varname = "$Check".$i; $varname = "Check".$i #echo $varname; if ($varname) echo "$varname = $i"; } Thanks much! John (Brr it's cold up here.) Luke Welling wrote: > "Jtjohnston" wrote: > > Anyone Awake? Up? >

Re: [PHP] Anyone Up?

2002-01-31 Thread jtjohnston
;"); > echo $string.""; > } > > Niklas > > -Original Message- > From: jtjohnston [mailto:[EMAIL PROTECTED]] > Sent: 1. helmikuuta 2002 9:16 > To: [EMAIL PROTECTED] > Subject: [PHP] Anyone Up? > > Anyone Awake? Up? > > I'm using 1

[PHP] Yawn, good morning? night? Whateva! :)

2002-02-03 Thread jtjohnston
Good day, morning, night? It's dark, so that makes it sleepy bye time. Bit before I do, I'm trying to work this out. I have a little bit of code to print Next n>> articles in my database. Can someone help me straighten out these lines of code, pretty please ... before I go fleeping nuts :) if(!$r

Re: [PHP] Can php Read contents from MS Word in Exactly sameformat

2002-02-03 Thread jtjohnston
Is there a function or class written to convert rtf reliably to html? :) Let me know, John A post & reply would be helpful if you can. "Jason G." wrote: > MS Word is a proprietary, binary (i think), format... Have fun. > > There may be a solution out there. > > If you could convince her to save

[PHP] MySQL

2002-02-05 Thread jtjohnston
In MySQL, I have a date field that is formatted 000-00-00 Is there a function in PHP I did not find yet that does this? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: MySQL

2002-02-05 Thread jtjohnston
$date = date ("Y-m-d"); #works? :) Jtjohnston wrote: > In MySQL, I have a date field that is formatted 000-00-00 Is there a > function in PHP I did not find yet that does this? > John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] << Previous n Articles

2002-02-05 Thread jtjohnston
I'm using this code to create a "Next n Articles >>" on my index.page from my mysql database. I worked most of it out myself. Then I got some help. It works. I thought I understood my own code enough to be able to construct a "<< Previous n Articles". I guess not. My coding skills need help. So ho

[PHP] Re: Dynamic Dropdown menu question.

2002-02-05 Thread jtjohnston
Michael, I think you're trying to kill yourself coding. here's what I do for myself: Select Someone EM."\">".$mydata->FirstName." ".$mydata->LastName."\n"; } mysql_close($myconnection); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] autoindex

2002-02-05 Thread jtjohnston
I want to reset the autoindex in a mysql table using php if I can. I found this. Can anyone help? http://www.mysql.com/doc/m/y/myisamchk_other_options.html J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] << Previous n Articles

2002-02-05 Thread jtjohnston
Jason, I'm not ssure I follow. $offset is the number i read in in my $limit is the number displayed. $num_rows is the number of rows in my database. What are you doing with $previous? $previous would be my string, not the previous offset? Could you show me again? > > if(!$offset) > > { > > $of

[PHP] http://

2002-02-07 Thread jtjohnston
I'm looking for a function that will find occurences of urls in any given string and do this: http://www.nowhere.com/ becomes http://www.nowhere.com/";>http://www.nowhere.com/ Could, should also look for mailto:[EMAIL PROTECTED] telnet:blah.blah or even news:blaj.blah Does such a thing exist?

[PHP] phpmyadmin-mysql

2002-02-17 Thread jtjohnston
Hello, I'm looking for code to display all my mysql databases in a . On change, I want to display all my tables in a . Finally, on change, it has to display all record of the table selected: Print Record id YR AU BT 1 1997 Fee, Margery Writing Orality: Interpreting

[PHP] Frustrating ?

2002-02-17 Thread jtjohnston
Heres's a frustrating, and maybe not so stupid question? I'm getting "Warning: Supplied argument is not a valid MySQL result resource" on this line: while ($mydata = mysql_fetch_object($news)) So what am I doing wrong here: $where = "id like $id"; $news = mysql_query('select * from ccl where '

[PHP] More: Frustrating ?

2002-02-17 Thread jtjohnston
> > while ($mydata = mysql_fetch_object($news)) > > So what am I doing wrong here: > > $where = "id like $id"; > > $news = mysql_query('select * from ccl where '.$where.' order by AU desc'); > //desc => z-a > A) Have you already confirmed that a valid database connection was made? Yes. A copy an

[PHP] setcookie()

2002-05-11 Thread jtjohnston
This is a bug "Feature/Change Request" I made to: http://bugs.php.net/bug.php?id=17158 setcookie() states "cookies must be sent before any other headers are sent (this is a restriction of cookies, not PHP). I argue this is a restriction of PHP, not cookies. Here is my proof: http://www.college

Re: [PHP] setcookie()

2002-05-11 Thread jtjohnston
als with server-side > issues. If you want to write javascript that sets a client-side > Javascript cookie, go ahead. It has nothing to do with PHP and PHP will > certainly not get in your way. > > -Rasmus > > On Sat, 11 May 2002, jtjohnston wrote: > > > This is a

Re: [PHP] setcookie()

2002-05-11 Thread jtjohnston
PHP and PHP will > > certainly not get in your way. > > > > -Rasmus > > > > On Sat, 11 May 2002, jtjohnston wrote: > > > > > This is a bug "Feature/Change Request" I made to: > > > http://bugs.php.net/bug.php?id=17158 > > >

[PHP] eval()

2002-05-20 Thread jtjohnston
I know I'm not doing this right, but .. What I want to do is display the value of $q1 through $q3. How? I can't get eval() to do it, can I? for ($i = 1; $i <= 3; $i++) { $x= eval ("\$q".$i); echo"$x\n"; echo"\n"; } John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] inspirational

2002-05-25 Thread jtjohnston
I want to detect the url my .php lies in. This is over kill and BS: $myurlvar = "http://".$SERVER_NAME.parse($SCRIPT_NAME); How do I get "http://foo.com/dir1/dir2/dir3/";. There seems to be nothing in phpinfo() that will give me a full url to play with. Flame me if you will, but I browsed TFM

[PHP] Calendar

2002-05-26 Thread jtjohnston
Can somone take a look at this? I found this on sourceforge, but cannot reach author. http://www.collegesherbrooke.qc.ca/languesmodernes/calendar/example.php This month won't display properly. It's missing somewhere. Every other month seems to work. Can someone help please? Here is the code:

[PHP] Calendar

2002-05-26 Thread jtjohnston
Can somone take a look at this? I found this on sourceforge, but cannot reach author. http://www.collegesherbrooke.qc.ca/languesmodernes/calendar/example.php This month won't display properly. It's missing somewhere. Every other month seems to work. Can someone help please? Here is the code:

[PHP] Calendar

2002-05-26 Thread jtjohnston
Can somone take a look at this? I found this on sourceforge, but cannot reach author. http://www.collegesherbrooke.qc.ca/languesmodernes/calendar/example.php This month won't display properly. It's missing somewhere. Every other month seems to work. Can someone help please? Here is the code:

[PHP] Calendar

2002-05-26 Thread jtjohnston
Can somone take a look at this? I found this on sourceforge, but cannot reach author. http://www.collegesherbrooke.qc.ca/languesmodernes/calendar/example.php This month won't display properly. It's missing somewhere. Every other month seems to work. Can someone help please? Here is the code:

[PHP] Need help

2002-02-20 Thread jtjohnston
Yeeesch! I neet help. I need a method to flush out lists of authors in a MySQL field called "KW". The field looks a bit like this: &&1; Caribbean and West Indies; Guyana;&&4;

[PHP] phpmyadmin

2002-02-21 Thread jtjohnston
I know this is a bit off the wall for most, but for what purpose do you use phpmyadmin & mysql? What are your projects? Does anyone know of any good articles that discuss databasing, PHP, MySQL and or PHPMyAdmin for academic purposes? I'm a university researcher and want to collect some data. Joh

[PHP] gzip?

2002-02-21 Thread jtjohnston
What header do I type to gzip something out on the screen? To make the output go faster, such as this text output: http://ccl.flsh.usherb.ca/db/export_to_nb_format.php I don,t want to actually zip the output, just make it go faster. Someone once told me I could do that so the server spits output f

[PHP] More: gzip?

2002-02-21 Thread jtjohnston
It's called GZIP output buffering whatever that may be? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] This?: ob_start

2002-02-21 Thread jtjohnston
Does this do it? ob_start(); while ($personne = mysql_fetch_object($news)) { $output = ""; $output .= "R#:".$personne->id."¶\n"; if($personne->TNum != ""){$output .= "T#:".$personne->TNum."¶\n";} $output = ob_get_contents($output); echo $output; ob_end_clean(); } -- PHP General Mailing Lis

[PHP] Result: ob_start

2002-02-21 Thread jtjohnston
I've narrowed down working code to this, but does it really do the job? Does this really go faster? header("Content-type: text/plain"); ... while ($personne = mysql_fetch_object($news)) { ob_start(); $output = ""; $output .= "R#:".$personne->id."¶\n"; if($personne->TNum != ""){$output .= "T#:".$

[PHP] foreach not in reach

2002-02-21 Thread jtjohnston
Question 1: How can I append strings to my authors array? Me thinks this doesn't work :§) ? $authors .= explode(";", $mydata->KW); I'm getting "Invalid argument supplied for foreach()" Question 2: Once I get this working, I want to (a) alphabetise the contents of the array, (b) count repititions,

[PHP] how to build an array

2002-02-22 Thread jtjohnston
I guess it's because I didn't really follow Niklas' post, so I'll ask the first part of yesterday's question again, if someone can help me think my way through it. I've been looking at http://www.php.net/manual/en/ref.array.php but don't really get HOW to build an array from my MySQL data. I'm ex

[PHP] Not Quite: how to build an array

2002-02-22 Thread jtjohnston
OK. I use: while ($mydata = mysql_fetch_object($news)) { $authors = explode(";", $mydata->AS); } Then why "Invalid argument supplied for foreach()" Am I indeed building an array as I go through my database? foreach($authors as $author) { #echo sort($author)".\n"; echo "$author\n"; } ht

Re: [PHP] Re: how to build an array

2002-02-22 Thread jtjohnston
Yeah but, this doesn't work either? I'm trying :) $news = mysql_query("select AS from $table"); while ($mydata = mysql_fetch_object($news)) { # $authors = explode(";", $mydata->AS); array_push ($authors, explode(";", $mydata->AS)); } foreach($authors as $author) { echo "$author\n"; }

Re: [PHP] login determines content on page

2002-02-22 Thread jtjohnston
What's the difference between if (isset($submit_happening)) and if $submit_happening) John [EMAIL PROTECTED] wrote: > On Fri, 22 Feb 2002 21:38:16 -0500, you wrote: > > >I'd to know how difficult it is to achieve the following: > > > >Create login page, when the submit button is clicked, the us

Re: [PHP] Not Quite: how to build an array

2002-02-23 Thread jtjohnston
I'm splitting mysql entries to build an array of author names called $authors. > As someone already suggested, you could use: > array_push($authors, explode(";", $mydata->AS)); http://ccl.flsh.usherb.ca/db/authors_under_study.php It works, but still gets "First argument to array_push() needs t

[PHP] countless

2002-02-23 Thread jtjohnston
Success. After a bit of tinkering :) and reading up. Thanks for the ideas. Now one last question. here is my array $authors: http://ccl.flsh.usherb.ca/db/authors_under_study.php sorted alphabetically. How do I go about sorting again it so it renders: Aguiar, Flavio1 Andrade, Mario d

[PHP] Re: I need a random number eather one or two

2002-02-23 Thread jtjohnston
rand (1, 2) http://www.php.net/manual/en/function.rand.php ? J "Philip J. Newman" wrote: > I'm trying to make a random number kind of a coin toss, > > heads = 1 = left > tales = 2 = right > > any solutions > > Philip J. Newman > Philip's Domain - Internet Project. > http://www.philipsdomain.com/

[PHP] Convert An Array

2002-02-24 Thread jtjohnston
http://ccl.flsh.usherb.ca/db/authors_under_study.php or $names = array ("john", "mary", "bill", "mary", "bill", "mary", "bill", "john", "bill", "john"); 1) How do I count the elements of $names to produce: bill 4 john 3 mary 3 2) How do I store the counted elements into a new array? How d

Re: [PHP] Access Array Values?

2002-02-24 Thread jtjohnston
I knew there was areason why I stopped Perling :) THANKS! How do I disassemble its values? How would I foreach? Something like this? foreach (array_count_values ($names) as $name and $count) <-?? { echo"".$name." (".$count.")`; } bill (3) john (3) mary (4) http://www.php.net/manual/en/f

Re: [PHP] Email Verification

2002-02-24 Thread jtjohnston
Is this what you want? function validateEmail ($email) { return (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)); } This will also do the job. It actually connects to the mail ser

[PHP] Re: ? re phpwebhosting.com - still in business??

2002-02-24 Thread jtjohnston
What's their deal? How do they offer all that and be so cheap? Using my site like Geocities to advertise? http://www.phpwebhosting.com/host_details.html J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Access Array Values?

2002-02-24 Thread jtjohnston
:) foreach (array_count_values ($names) as $name=>$count) Thanks M! :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] mysql 4 windows

2002-02-24 Thread jtjohnston
Does anyone know if mysql 4 windows is up to snuff yet? I'm running http://www.easyphp.org/ Can it be installed as localhost2? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] if(isset($submit))

2002-02-27 Thread jtjohnston
Has anyone tried: instead of : >\"> I can't get this to work: if(isset($submit)) with: I'm not coding correctly? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: PHP MAIL function...why wont it work????

2002-02-27 Thread jtjohnston
Your smtp is valid? Try error checking for that? See you php.ini. If you are running it on localhost you might try the same smtp that is used in your emailer. I gaffed on that once. :) Brad Wright wrote: > Hi all... I have a line in a page that should send me an email when the page > is loaded.

Re: [PHP] if(isset($submit))

2002-02-27 Thread jtjohnston
ubmit.y=20 > > so php would get this as $submit_x and $submit_y > > HTH > Martin > > -Original Message- > From: jtjohnston [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 28, 2002 4:17 PM > To: [EMAIL PROTECTED] > Subject: [PHP] if(isset($submit)) > &

Re: [PHP] if(isset($submit))

2002-02-27 Thread jtjohnston
ubmit.x=118&submit.y=20 > > so php would get this as $submit_x and $submit_y > > HTH > Martin > > -Original Message- > From: jtjohnston [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 28, 2002 4:17 PM > To: [EMAIL PROTECTED] > Subject: [PHP] if(i

Re: [PHP] if(isset($submit))

2002-02-27 Thread jtjohnston
&submit.y=20 > > so php would get this as $submit_x and $submit_y > > HTH > Martin > > -Original Message- > From: jtjohnston [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 28, 2002 4:17 PM > To: [EMAIL PROTECTED] > Subject: [PHP] if(isset($submit))

[PHP] isset?

2002-02-27 Thread jtjohnston
So what is the good of isset? What does if(isset($submit)) do differently than if($submit) ?? J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] if(isset($submit))

2002-02-27 Thread jtjohnston
Over kill? Martin Towell wrote: > or have a hidden field, maybe, called "submit" > > -Original Message- > From: jtjohnston [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 28, 2002 4:33 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] if(isse

[PHP] Apache & PHPMyAdmin

2002-03-02 Thread jtjohnston
Hi, No one seems to be home at my favourite apache newsgroup :) so I'll ask here. I'm trying to reconfigure my PHPMyAdmin. What do I add to my conf file so as in http://phpmyadmin.somehere.com/ points to a specific directory on my (windows) drive? For example, how would I point http://www.somehe

[PHP] Does anyone follow?

2002-03-04 Thread jtjohnston
Does anyone follow what I'm trying to do? I have a list of authors I explode from a field called AUS. I sort them sort($authors); The layout is agreeable. What I would like now to do is change: array_push($authors,$singleauthor); for array_push($authors,$singleauthor,$mydata->id); But

Re: [PHP] Does anyone follow?

2002-03-04 Thread jtjohnston
Can you show me how :) ? I'm in over my head. I get working with arrays, but need more practice, examples etc. to learn how to code from. How would two arays work? John > Does anyone follow what I'm trying to do? > > I have a list of authors I explode from a field called AUS. I sort them > sort(

[PHP] Ifrst

2002-03-04 Thread jtjohnston
Is this over kill? Is there a "better" way? I have an array. I want to display all occurences of strings that start with "a" or "A". http://www.php.net/manual/en/function.substr.php $rest = substr($mystring, 0, 1); // returns "a" ? -- PHP General Mailing List (http://www.php.net/) To unsubscr

[PHP] case insenstive

2002-03-04 Thread jtjohnston
I need to make this case insensitive. This seems like over kill? if((substr($author, 0, 1) == "a") or (substr($author, 0, 1) == "a")) { } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] sort()

2002-03-04 Thread jtjohnston
Thanks! Has this ever been improved? It sorts but case insensitively. Is this over kill :) usort($authors, create_function('$a,$b','return strcasecmp($a,$b);')); D'Alpuget, Blanche d'Alpuget, Blanche da Silva e Orta, Teresa Margarida Dabydeen, Cyril de Campos, Haroldo De Certeau, Michel de Certe

[PHP] exists?

2002-03-05 Thread jtjohnston
It's late, I'm tired. I want to parse $searchenquiry if("%" exists in $searchenquiry) { do ... }else{ do ... } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] $db_list = mysql_list_dbs

2002-03-06 Thread jtjohnston
mysql-list-dbs works but displays all databases. How do I limit to display those that a user has access rights to? http://www.php.net/manual/en/function.mysql-list-dbs.php $link = mysql_connect($server, $user, $password); $db_list = mysql_list_dbs($link); while ($row = mysql_fetch_object($db_

[PHP] how to access an ini file using PHP

2002-03-06 Thread jtjohnston
[Posted and Replied] Salut Marc, You could find an ini file function. Something like: http://www.zend.com/apidoc/c1948.php http://ca.google.yahoo.com/bin/query_ca?p=how+to+access+an+ini+file+using+PHP&y=on&hc=0&hs=0 You would have to add one line: [MyData] name=foo age=100 sex=y I've done it

[PHP] Re: File/Directory Permissions

2002-03-06 Thread jtjohnston
I know you would want to code your chmod, but I use my CuteFTP window to auto-calculate which permissions I want to use/code. Not necessary on Windows, but on Unix it's an absolute. I use 644 (Read Owner, Read Group, Read Public,Write Owner, on a Unix server with no trouble for normal *.PHP files

[PHP] Is flock necessary?

2002-03-06 Thread jtjohnston
Group: Is flock even necessary? Allan: You look like you have Perled. It was necessary for Perl. Have you thought of MySQL instead? Alan McFarlane wrote: > I've just written a couple of simple routines which read an write small text > files to the server: > > function readData( $filename, &$dat

[PHP] Use an ini file

2002-03-07 Thread jtjohnston
Anyone know of an easy to use library/or code that will read and write an ini file? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Use an ini file

2002-03-07 Thread jtjohnston
> > Anyone know of an easy to use library/or code that will read and write > > an ini file? > See parse_ini_file() together with the file handling functions. Dave, http://www.php.net/manual/en/function.parse-ini-file.php Good, but no code to write to an ini file? :) John -- PHP General Mailing

[PHP] CSS

2002-03-08 Thread jtjohnston
Has anyone any code that creates a CSS file? A GUI? As in: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] CSS Group

2002-03-09 Thread jtjohnston
Can anyone recommend a good CSS news group? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Broadcasting

2002-03-10 Thread jtjohnston
Not really a php thing, more a loss of php :) ! My PHP-MySQL server has been stolen from my office (last night). Security has not been doing their job! I noticed in the logs once where people were trying to get in by FTP on occasion, or adding weird things to a url, when it was running just as a

[PHP] Broadcasting

2002-03-10 Thread jtjohnston
Not really a php thing, more a loss of php :) ! My PHP-MySQL server has been stolen from my office (last night). Security has not been doing their job! I noticed in the logs once where people were trying to get in by FTP on occasion, or adding weird things to a url, when it was running just as a

[PHP] Broadcasting

2002-03-10 Thread jtjohnston
Not really a php thing, more a loss of php :) ! My PHP-MySQL server has been stolen from my office (last night). Security has not been doing their job! I noticed in the logs once where people were trying to get in by FTP on occasion, or adding weird things to a url, when it was running just as a

[PHP] rec_copy

2002-03-13 Thread jtjohnston
You might have seen a version of this function: http://www.php.net/manual/en/function.copy.php I would like to rework this line: mkdir($to_path, 0777); where mkdir will ignore $to_path if the directory already exists. I have already tried this: #if(!mkdir($to_path, 0777)) # {mkdir($

Re: [PHP] rec_copy

2002-03-13 Thread jtjohnston
So I just declare at the beginning: if(!is_dir($to_path)) mkdir($to_path, 0777); The code works. But how can I make sure $from_path exists first and fails if not? Same thing? if(!is_dir($from_path)) { echo "failed"; exit; } The first time I ran it, I ran it with a non-existing $from_path direc

[PHP] Double slash

2002-03-13 Thread jtjohnston
On a windows server, echo getcwd().""; gives me: C:\WINDOWS\Bureau\php\microweb How do I double slash it? Is this ok: $test_path = getcwd()."\\test1\\"; echo $test_path; It seems ok, when I echo it? Any screwy Windows thing I need to know about? John -- PHP General Mailing List (http://w

Re: [PHP] Double slash

2002-03-13 Thread jtjohnston
>looks good to me - only screwy thing I can think of is the backslash thing - >REALLY annoying - and confusing sometimes Yeah, no kidding. Thanks Martin! What about if I try copying $to_path onto a Network server? Do you see any problems with the code and $to_path? (Not that I have a serve

[PHP] Re: What permissions for uploading?

2002-03-13 Thread jtjohnston
Not to but in, but you might want to check on your version. www.php.net published an advisory on a possible flaw on that very issue: http://www.php.net/release_4_1_2_win32.php http://security.e-matters.de/advisories/012002.html Leif K-Brooks wrote: > I have a script that allows the user to uplo

[PHP] New Day, New Problem

2002-03-14 Thread jtjohnston
If I change: $to_path = "c:\\".$date."www\\"; to $to_path = "c:\\".$date."\\www\\"; It doesn't work? Otherwise, it works. Can anyone help? Undoubtably something f-ed in the code, or is it a Windows thing? ### $date = date ("Ymd");

[PHP] Weird?

2002-03-15 Thread jtjohnston
Does anyone have time to run this code? This is definitely weird. Either a Windows or a code problem. If I set: $to_path = "c:\\ccl_www\\".$date."ccl_www\\"; to: $to_path = "c:\\ccl_www\\".$date."\\ccl_www\\"; (I add \\) It fails to create c:\ccl_www\20020315\ccl_www, but otherwise will create

[PHP] [More] Re: Weird?

2002-03-15 Thread jtjohnston
Miguel, No, You're right I wasn't running E=All. It's a windows machine, so I have all the write priveledges I want. These are the errors I'm getting: Warning: stat failed for c:\ccl_www\MarFriccl_www\ (errno=2 - No such file or directory) in C:\WINDOWS\Bureau\php\microweb\backup4.php

[PHP] Update: [PHP] Weird?

2002-03-16 Thread jtjohnston
I have created date :) $date = date ("MD"); That's not it. It seems to fail at one level or another, I think, becuase the function calls itself - and probably gets lost somehow. John > ... i think you might have to create the > $date directory before writing a file to it. > writing to /tmp/dir/fi

[PHP] PHPMyAdmin: [PHP] From: Newman, using " and ' or ` in My Sql

2002-03-16 Thread jtjohnston
> The standard quote (') should be used to delimit string literals in MYSQL > statements. Use it to surround strings you're inserting into or comparing > against VARCHARs, CHARs, TEXTs, etc. > $sql = "UPDATE mytable SET name='Best Table Of All' WHERE id=3"; That is ok if you call MySQL in your

[PHP] No Sense: [PHP] Update: [PHP] Weird?

2002-03-16 Thread jtjohnston
te: > I meant, have you created a physical directory > named $date? > That's your problem. There's no directory named $date on your computer, and > you're > trying to write files into a non-existent directory. > > jtjohnston wrote: > > I have created date :) &g

[PHP] Re: [PHP] Weird?

2002-03-16 Thread jtjohnston
Dave, That's just the problem with the code. See the snippet, http://www.php.net/manual/en/function.copy.php The function should MKDIR for me one level at a time as the function calls itself. It should MKDIR and copy *.* if (is_dir($file)) { rec_copy ($from_path.$file."/", $to_path.$file.

[PHP] Copy *.*

2002-03-16 Thread jtjohnston
Does anyone know of another snippet any place where I can copy *.* (files and all sub-directories) from one drive to another? In other words, a "backing-up" function. The snippet I got from http://www.php.net/manual/en/function.copy.php has been a disaster. John -- PHP General Mailing List (ht

[PHP] Re: Invalid Argument ??? Not sure how to debug this

2002-03-17 Thread jtjohnston
Daniel, $myrow["artist"] and $myrow["title"] might be a good place to start. It looks like all your ; are in place. I don't think you can place " inside [] like that: echo "".$myrow["artist"]."".$myrow["title"]; > I have been struggling with this code: I was wondering if someone could > lend

  1   2   >