[PHP] Seg fault in PHP 5.0.5

2005-11-12 Thread Dean Householder
Has anyone had any problems with PHP 5.0.5 getting seg faults when 
trying to replace extended ascii characters?


I'm trying to replace the following characters: Â °, with  degrees.  I 
am able to detect these characters in the string, but when I try 
replacing it, PHP seg faults.  I've tried both str_replace() as well as 
preg_replace().  I've tried replacing the characters by pasting them 
directly, using chr(176)  chr(194), and even \xC2 and \xB0.


I get the Segmentation fault both through Apache as well as CLI (command 
line interface) consistently.


Any ideas?

Thanks,
Dean Householder

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Break up query into pages using PHP from MsSQL

2002-03-27 Thread Dean Householder

I'm trying to split results into different pages and number the pages
accordingly. I'm using PHP and accessing a MsSQL database. I've been able to
build a fairly intelligent page numbering system which knows which rows it
should pull (at least by numbering each row numerically) but I don't know
how to construct a SQL query to pull 10 results starting at a certain
number. I know MySQL has a function called offset. This combined with the
limit function would be great! But MsSQL doesn't seem to work in the same
way. Here's what I have so far:

SELECT count(id) FROM members WHERE bla bla bla

then load that into a variable called $total.

SELECT TOP 10 * FROM members WHERE bla bla bla

TOP is the function to only pull a certain number of records. (I had to
figure that out the hard way!) I was thinking of possibly making the WHERE
statement like

WHERE id = $start AND id = $start + 10

But that only works if my indexes are consistant. Which they aren't!  As I
see it, I either need to reindex the table, find a function in MsSQL that
works, or pull everything into a big PHP array and try to sort it out there.

Any hints or suggestions would be greatly appreciated!!!

Thanks,
Dean


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Simple chat

2002-02-28 Thread Dean Householder

You can try a very cheesy solution.  Totalsimplicity will host a free chat
room without any installation.  All you have to do is go to the following
link:
http://www.totalsimplicity.com/genchat.php?fromj=y
and specify the name of the chat room you want to create and it will
generate the code to add to a link on your website. It will come up with
something like:
a href=
onClick=window.open('http://www.totalsimplicity.com/chat/?channel=Chat',
'chat',
'width=720,height=425,status=1,menubar=no,resizable=no,scrollbars=yes');
return false;Come chat with us!/a

Very simple. Your chat room dies when there are noone is inside it.  This
requires no installing programs on your computer, or setting up an account
somewhere.

Dean Householder

- Original Message -
From: Danilo Dias [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 28, 2002 11:08 AM
Subject: [PHP] Simple chat


 I have 2 problems.

 Problem #1:
 I need to make a simple chat page. When a user logs in, he should be able
to
 see everyone that is logged in, and send messages to all. Just that. Its
not
 necessary that they send messages to a particular person. I need just one
 room.
 It may be simple, but I have no experience making web pages.

 Problem #2:
 The first one to enter the chat is redirected to another page, where he
can
 make experiments. When he exits this page, a pop-up message should appear
in
 the second to enter´s screen, asking if he wants to enter the experiment
or
 not. If he answers yes, he will be redirected to the another page, if
not,
 he will go to the last place of the FIFO, and the pop-up message should
 appear to the next in the FIFO. And so on.

 If anybody could help me with any of this problems I would be grateful.
 Remember I have no experience with web pages, php, javascript, so it would
 be good if there is no difficult terms in the explanation. Thanx.


 Danilo Dias
 [EMAIL PROTECTED]

 _
 Oi! Você quer um iG-mail gratuito?
 Então clique aqui: http://registro.ig.com.br/censo/igmail


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Dumb question on terminology

2002-02-26 Thread Dean Householder

Some arrays use the format:
$row-data

while some use:
$row['data']

What is the terminology of these types so I sound like I know what I'm talking about.  
Also, when and how do each come about?

Dean



[PHP] Is there an MSSQL limit function?

2002-02-16 Thread Dean Householder

I want to run a query like:

select * from table order by rand() limit 3

in MySQL it would work but I need to run it in MSSQL.  I've been searching for a limit 
function in MSSQL and I can't find a way to do it.  I'm experienced with MySQL but 
know nothing about MSSQL.  If someone could point me in the right direction I would 
really appreciate it!

Thanks,
Dean




Re: [PHP] Is there an MSSQL limit function?

2002-02-16 Thread Dean Householder

Is anyone familiar with how exactly to use the TOP command in MSSQL?  Is it
in it's own SQL query or built into the select query?  I'm looking at the
help and it doesn't seem very helpful...

Dean


- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, February 16, 2002 2:28 AM
Subject: Re: [PHP] Is there an MSSQL limit function?


 On Saturday 16 February 2002 17:14, Dean Householder wrote:
  I want to run a query like:
 
  select * from table order by rand() limit 3
 
  in MySQL it would work but I need to run it in MSSQL.  I've been
searching
  for a limit function in MSSQL and I can't find a way to do it.  I'm
  experienced with MySQL but know nothing about MSSQL.  If someone could
  point me in the right direction I would really appreciate it!

 I think it's TOP in MSSQL.


 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 Let's remind ourselves that last year's fresh idea is today's cliche.
 -- Austen Briggs
 */

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Is there an MSSQL limit function?

2002-02-16 Thread Dean Householder

I figured it out!

For benefit of all I'm posting the answer:

select top 3 * from table

This query will return the top three rows of the table but now I want to
them to be random.

Once again, in MySQL you could just say order by rand() but that doesn't
work in MSSQL.  Does anyone know how to do this?

Dean

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, February 16, 2002 2:54 AM
Subject: Re: [PHP] Is there an MSSQL limit function?


 On Saturday 16 February 2002 17:48, Dean Householder wrote:
  Is anyone familiar with how exactly to use the TOP command in MSSQL?  Is
it
  in it's own SQL query or built into the select query?  I'm looking at
the
  help and it doesn't seem very helpful...

 It's been a while since I last used MS dbs. But I think it goes something
 like:


 SELECT * FROM table TOP 5;


 In fact I checked the help of Access and it is detailed there.


 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 The primary requisite for any new tax law is for it to exempt enough
 voters to win the next election.
 */

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Passing objects

2002-01-25 Thread Dean Householder

How can you pass an object from one page to another?  Is there any convenient way to 
do it with PHP?

Dean



Re: [PHP] Passing objects

2002-01-25 Thread Dean Householder

I'm pretty new to PHP.  If anyone can elaborate a little on this I would
appreciate it greatly.

Thanks


-- 
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]




Re: [PHP] PHP array or SQL problem

2002-01-15 Thread Dean Householder

Thanks so much!!  You guys rock!
Dean


- Original Message -
From: Dean Householder [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 15, 2002 12:34 AM
Subject: [PHP] PHP array or SQL problem


I've got a database with lname (lastname), fname (firstname), and nickname.

What I want to do is search by either first name or last name.  Either way,
I display the nickname instead of the firstname if it exists.  I have no
problems on the last name, but when I sort by firstname, the people with
nicknames that are very different come up at the place where their first
name (not the displayed name) is.

For example:

Adam Smith
Joe Schmoe
Bill Somebody

When Bill Somebody is really William Somebody in the database, his nickname
is bill and that's what's displayed but he 'bill' shows up in 'williams'
spot.  Here is my SQL query:

select * from employees order by fname;

Should I create an array and sort it there or can I somehow query MySQL to
sort by nickname only if it exists and then by fname?

Dean



-- 
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] PHP array or SQL problem

2002-01-14 Thread Dean Householder

I've got a database with lname (lastname), fname (firstname), and nickname.

What I want to do is search by either first name or last name.  Either way, I display 
the nickname instead of the firstname if it exists.  I have no problems on the last 
name, but when I sort by firstname, the people with nicknames that are very different 
come up at the place where their first name (not the displayed name) is.

For example:

Adam Smith
Joe Schmoe
Bill Somebody

When Bill Somebody is really William Somebody in the database, his nickname is bill 
and that's what's displayed but he 'bill' shows up in 'williams' spot.  Here is my SQL 
query:

select * from employees order by fname;

Should I create an array and sort it there or can I somehow query MySQL to sort by 
nickname only if it exists and then by fname?

Dean



Re: [PHP] Piping data into a select box

2002-01-13 Thread Dean Householder

Thank's for the help!
Dean

- Original Message -
From: Jimmy [EMAIL PROTECTED]
To: Dean Householder [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, January 13, 2002 12:33 AM
Subject: Re: [PHP] Piping data into a select box


 Hi Dean,

  Does anyone know how to give a select pulldown box a default value
  from a PHP variable?

 ?
 function generate_option_list ($key_value,$set) {
 // This function will return option list and set the selected attribute
 // $key_value : the associative array which contain the key and the value
for each option
 // $set : the value to be selected by deafult
 //
 // Usage: for example we want to have a dropdown list of month, and set
February as selected
 //
 //   $key_value=array(01=January,02=February,...);
 //   $option_list=generate_option_list($key_value,02);
 //   //$option_list now contain text option value='01'January/option
 //   //  option value='02'
selectedFebruary/option
 //
 // NOTE: This will only create the OPTION tag, without the SELECT tag
 //

   while ( list($key,$value) = each($key_value) ) {
 if ($key==$set) {$var.=option value='$key'
selected$value/option;}
 else {$var.=option value='$key'$value/option;}
   }
   return $var;
 }

 ?

 --
 Jimmy
 
 Leave loved ones with loving words, it may be the last time you see them





-- 
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] Piping data into a select box

2002-01-12 Thread Dean Householder

Does anyone know how to give a select pulldown box a default value from a PHP variable?

I've been able to figure out how to pipe data into every type in input  type of form 
element except for a select  element.  Any solutions would be helpful!

Dean



[PHP] Test if picture exists then load.

2002-01-10 Thread Dean Householder

I'm not sure what function I need to use, but I want to test if a picture exists in a 
directory and if it does to display it but if not display another graphic that says 
'No Graphic Available'.  

Would that be fopen()?  or something else?  I'm still new to PHP so any feedback would 
be very appreciated.

Dean



Re: [PHP] [newbie] passing variables

2001-11-19 Thread Dean Householder


- Original Message -
From: pjc [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, November 19, 2001 5:59 PM
Subject: [PHP] [newbie] passing variables


 I just started playing with PHP and MySQL and am building an online
 phonebook for myself.

 From my 'view_all_numbers.php' I have a link that looks something like
this:
 a

href=delete_entry_confirm.php?first=yourfirstnamelast=yourlastnameDELETE
 /a

 Here is the code from delete_entry_confirm.php
 ?
 echo h3 align=centerAre you sure you want to delete br;
 echo i.$first. .$last./i;
 echo brfrom the phonebook?/h3\n\n;
 echo form action='delete_entry.php' action='get'\n;
 echo \t input type='hidden' name='first'
 value='.stripslashes($first).'\n;
 echo \t input type='hidden' name='first'
 value='.stripslashes($last).'\n;
 echo input type=submit value='Delete This Entry';
 echo  input type=button value='I would rather keep it...'
 onclick='javascript:history.back();';
 echo /form;
 ?
 ===
 And here's the code from my delete_entry.php
 ?
 if(!$last || !$first) {
  echo h4 align=centerSomething's fucked up with yo script ya
 herd.../h4;
  exit;
 }

 $db = @mysql_connect(localhost,login,pass);

 if (!$db)
  {
  echo bDatabase ain't workin dawg!!/b;
  exit;
  }

 mysql_select_db(paultest);
 $query = delete from phonebook where last='.$last.' and
 first='.$first.';
 $result = mysql_query($query);
 if($result)
  echo h3.mysql_affected_rows(). record(s) deleted./h3;
 ?
 ===

 This link does work though: a
 href=delete_entry.php?first=yourfirstnamelast=yourlastnameYES I WANT
TO
 DELETE/a

 The error that I am getting on delete_entry.php is that my variables
aren't
 there. Any suggestions folks?

 Thank you in advance.
 -p

 --

 Paul C
 [EMAIL PROTECTED]
 ICQ:68274240

 You can't put a bag over someone's personality.






 --
 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]




Re: [PHP] [newbie] passing variables

2001-11-19 Thread Dean Householder

Well for one

 echo \t input type='hidden' name='first'
 value='.stripslashes($first).'\n;
 echo \t input type='hidden' name='first'
 value='.stripslashes($last).'\n;

Both of these fields are called 'first' instead of 'first' and 'last' so the
last name is actually overwriting your first name.
Secondly, you are not using proper php variables into
delete_entry_confirm.php.  I'm guessing that this is an .html file because I
don't see an 'echo' statement in front, so the only way to send the
variables without using php code is to populate data in a form using hidden
input fields and a submit button called delete, or to use php and send the
variables like this:

echo 'a href=delete_entry_confirm.php?first=' . $yourfirstname . 'last='
. $yourlastname . 'DELETE/a';

Good luck.
Dean Householder
http://www.daylightcreations.com


pjc [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I just started playing with PHP and MySQL and am building an online
 phonebook for myself.

 From my 'view_all_numbers.php' I have a link that looks something like
this:
 a

href=delete_entry_confirm.php?first=yourfirstnamelast=yourlastnameDELETE
 /a

 Here is the code from delete_entry_confirm.php
 ?
 echo h3 align=centerAre you sure you want to delete br;
 echo i.$first. .$last./i;
 echo brfrom the phonebook?/h3\n\n;
 echo form action='delete_entry.php' action='get'\n;
 echo \t input type='hidden' name='first'
 value='.stripslashes($first).'\n;
 echo \t input type='hidden' name='first'
 value='.stripslashes($last).'\n;
 echo input type=submit value='Delete This Entry';
 echo  input type=button value='I would rather keep it...'
 onclick='javascript:history.back();';
 echo /form;
 ?
 ===
 And here's the code from my delete_entry.php
 ?
 if(!$last || !$first) {
  echo h4 align=centerSomething's fucked up with yo script ya
 herd.../h4;
  exit;
 }

 $db = @mysql_connect(localhost,login,pass);

 if (!$db)
  {
  echo bDatabase ain't workin dawg!!/b;
  exit;
  }

 mysql_select_db(paultest);
 $query = delete from phonebook where last='.$last.' and
 first='.$first.';
 $result = mysql_query($query);
 if($result)
  echo h3.mysql_affected_rows(). record(s) deleted./h3;
 ?
 ===

 This link does work though: a
 href=delete_entry.php?first=yourfirstnamelast=yourlastnameYES I WANT
TO
 DELETE/a

 The error that I am getting on delete_entry.php is that my variables
aren't
 there. Any suggestions folks?

 Thank you in advance.
 -p

 --

 Paul C
 [EMAIL PROTECTED]
 ICQ:68274240

 You can't put a bag over someone's personality.






 --
 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]




Re: [PHP] A powerful editor!

2001-10-02 Thread Dean Householder

I used to use TextPad until I found EditPlus.  I'm also amazed by it's
power.  It has more than I could even use including everything TextPad has
and nicer colors for the different styles.  You can find it at
http://www.editplus.com.

Dean Householder
Daylight Creations
http://www.daylightcreations.com



- Original Message -
From: Alex Shi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 01, 2001 6:08 PM
Subject: [PHP] A powerful editor!


 Hello folks,

 Today, I found a very powerful editor, called TextPad. I said it is
 'powerful'
 because it can recognize syntax of php, html, java, css and also many
 many more great featuresmuch better that Windows Notepad. You can
 download and try. You need to take a few minutes to explore it and
maximize
 its functionality for you.

 Here is the link:
 http://www.textpad.com/

 Alex




 --
 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]