[PHP] 37 Pictures the World must see

2008-10-03 Thread Alex Hogan
I'm not one to send or pass along viral email, but this is one I have to
pass on.  They ask nothing but for you to fill in your name and email
address to pass along to your Congressman.  You can even opt to not be
contacted again.

Please take time to view this and click the "Sign" link to email your
congressman.


 Thank you,


 alex*hogan*

~

*
*

*"I'm working on a story that the world needs to know about. I wish for you
to help me break it, in a way that provides spectacular proof of the power
of news photography in the digital age."*
*James Nachtwey*

 Today, this major TED Prize wish is coming true.

I urge you to take three minutes out of your day, and click on this link:

www.xdr*tb*.org<http://tr.subscribermail.com/cc.cfm?sendto=http%3A%2F%2Fxdrtb%2Eorg&tempid=eed5fb177334431d9f5bf53c33025f7a&mailid=48402e579a3f4b9fa024e5ce4695fe78>

(I recommend clicking on the arrow at bottom right of the video player to
enlarge it.)

Tonight these pictures will be projected in some 50 cities all over the
world.  We wanted you to see them first.

I will follow up shortly with another note about this extraordinary story.



Chris Anderson, TED Curator


Re: [PHP] learning classes - need pointer

2005-05-16 Thread Alex Hogan
> 
> In my current case, I am trying to create all the generic SQL
> functions (IE insert, update, delete, etc). Now what I am wondering -
> what would be the best way to structure the code so that I can
> accommodate the possibilities for different fields and databases,
> etc? Is it something that I should just pass to the class? Or would
> there be a more efficient way to do it?

 One of the things I hate most is having to rewrite code for insert and 
update. With that in mind what I do is name the form objects the same name 
as the db fields that they relate to. Then I iterate through the $_POST 
array as a whole and do the insertions and updates like that. The only thing 
that I have to pass to my class is the table name and any location string 
that will accompany the successful completion of the insert/update. All my 
validation is done right there with method overloading.
 It's not extremely clever by any means but it gets the job done. Besides 
I'm kinda lazy.
 I'm sure there are several wrappers that do the same thing.
  alex hogan


Re: [PHP] Limit iterations on a foreach loop?

2005-02-11 Thread Alex Hogan
> I'm using an RSS feed that has WAY too much content, I only want the
> first 10. I'm outputting the array with a foreach loop: is there a way
> to limit it to only go through the first 10?

foreach($var as $newvar){
if($count <= 10){
// Do something here
}
else{
    break;
}
}

alex hogan

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



Re: [PHP] avoiding user using back button-need to re-route

2005-02-10 Thread Alex Hogan
[snip]
is there a way to "route" from my second last step to my last one with a
php page between them that will intercept any back press and also will
"redirect" when the process goes from the second last step to the last
step. If the user clicks back from the last page it must then determine
that he is going back and redirect to an error page or a login page.
[/snip]

On the processing page you could put something like;
if($_SERVER['HTTP_REFERER'] != 'myFormPage.php'){
header("Location: YouGotHereWrong.php");
}


alex hogan

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



RE: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread Alex Hogan

[snip]
BTW. What is STFU?
[/snip]

Ooo.., let me do this one...
This is one I can answer. ;-)

STFU (Shut the F*%# up!)





alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential 
and 
intended solely for the use of the individual or entity to whom it is 
addressed. The 
views stated herein do not necessarily represent the view of the company. If 
you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, 
or 
otherwise use it or any part of it in any form whatsoever. If you have received 
this 
e-mail in error please e-mail the sender. 
*

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



[PHP] mssql_fetch_array() vs. mssql_fetch_assoc

2004-11-11 Thread Alex Hogan
In terms of performance which is faster.

mssql_fetch_array($var,mssql_assoc) or mssql_fetch_assoc()?

I read in the manual that mssql_fetch_array() isn't noticably slower
than mssql_fetch_row(), but I didn't see anything about
mssql_fetch_assoc() in terms of performance.

I was wondering if anybody already knew what the performance differences were.

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



Re: [PHP] 'Code Snippets' you couldn't live without

2004-11-03 Thread Alex Hogan
> snippets they couldn't live without when working on a PHP project. IE, the
> kind of re-usable bits and pieces that make your life a lot easier.

I hate always having to write queries for inserting and updating a db.
 With this I can just name the form objects the same names as the
table fields and I'm done.

function insert($table, $fld, $val){
   $query = "INSERT INTO $table (%s) VALUES (%s)";
   $query = sprintf($query, implode(",", $fld), implode(",", $val));
   $result = mssql_query($query) or die;
}   


alex hogan

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



Re: [PHP] Regular expressions Q

2004-10-28 Thread Alex Hogan
> ereg("(([[:blank:]+]|^)[09][0-9][4789][0][0-9]{3}[abcABC]?)","$zn[1]",$zaakn
> ummers1);
> 
> I thought that ereg would get all of them and store them in the array
> $zaaknummers1 however this is not the case

I just asked a question similar to this the other day.
Try using;

preg_match_all("(([[:blank:]+]|^)[09][0-9][4789][0][0-9]{3}[abcABC]?)",
$zn[1], $zaaknummers1);




alex hogan

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



Re: [PHP] Regex Lookbehind help

2004-10-26 Thread Alex Hogan
> Check the documentation for preg_match()...it can't be used that way.  It returns
> false or the number of matches, but not the matching text itself.  To get the
> matches you have to supply the third parameter (matches).  Plus you'll probably 
> want to use preg_match_all() unless you only want to get the first match.

I caught that after I reread the manual.


> Also, I don't believe readfile() is what you want.  It looks like
> file_get_contents() is more in line with what you are trying to do.

That's got it.

Thanks...


alex hogan

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



Re: [PHP] Regex Lookbehind help

2004-10-26 Thread Alex Hogan
> I just tried this out and the first regex is actually working for me on php 4.3.8
> (cli).  Can you post some code?

At this point all I'm trying to do is print the array with the addresses.

$file=readfile('mypathto/myfile.html');
$patrn =(\w[-._\w]*\w(?http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Regex Lookbehind help

2004-10-26 Thread Alex Hogan
Hi All,

I am trying to identify an email address in a page but I don't want to
return the email if it's [EMAIL PROTECTED]

Here's what I have;
(\w[-._\w]*\w(?http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How to load another php page?

2004-10-02 Thread Alex Hogan
[snip]
How can i load another php file ("another.php") directly without an action
(example: clicking on a button)?
[/snip]

If you're looking to check a condition and then add another php file
to your existing page then;

if(isset($var1)) { 
include ('another.php'); 
or
include_once('another.php');
}
is what you're looking for.

If you're looking to redirect to another file based on a condition then;

if(isset($var)){
header('Location: another.php');
}

will work.


alex hogan

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



Re: [PHP] Need help with a regular expression

2004-09-30 Thread Alex Hogan
[snip]
"^Q4_[0-9]$"
&
Yes, your understanding of "^Q4_.[0-9]$" is wrong. 
[/snip]

Thanks guys..,
I did take the '.' out of the expression, but I also had to change the
way I was using it.

I replaced;
if($key == ereg( "^Q4_.[0-9]$", $key)){
with
if(ereg( "^Q4_.[0-9]$", $key)){

alex hogan

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



[PHP] Re: Need help with a regular expression

2004-09-30 Thread Alex Hogan
Please ignor...

I got it...


alex


On Thu, 30 Sep 2004 16:22:02 -0500, Alex Hogan <[EMAIL PROTECTED]> wrote:
> I have a series of questions that are multiple choice.  Some of the
> questions have multiple answers to them.
> 
> Those questions have answers that are indicated by a checkbox that is
> named something like;
> Q4_1
> Q4_2
> etc...
> 
> Of those, each one of the checkboxes that indicate a correct answer is
> given a point value.
> 
> I need only get the total points of question 4 and not the individual
> checkbox scores.
> 
> What I have;
> 
> foreach($_POST as $key => $value){
>if($key != 'Submit'){
>if($key == ereg("^Q4_.[0-9]$", $key)){
>$Q4score[$i] = $value;
>}
>print $key.": ".$value."";
>$Score[$i] = $value;
>}
> 
>$i++;
> }
> print 'Q4: '.array_sum($Q4score); - Returns 0
> print 'Total: '.array_sum($Score); - Returns correctly
> 
> Is my ereg() wrong?
> My understanding is ereg("^Q4_.[0-9]$", $key) should look for a $key
> starting with 'Q4_' followed by a single number and place those values
> into an array named $Q4scores.
> 
> What am I missing?
> 
> Thanks,
> 
> alex hogan
>

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



[PHP] Need help with a regular expression

2004-09-30 Thread Alex Hogan
I have a series of questions that are multiple choice.  Some of the
questions have multiple answers to them.

Those questions have answers that are indicated by a checkbox that is
named something like;
Q4_1
Q4_2
etc...

Of those, each one of the checkboxes that indicate a correct answer is
given a point value.

I need only get the total points of question 4 and not the individual
checkbox scores.

What I have;

foreach($_POST as $key => $value){
if($key != 'Submit'){
if($key == ereg("^Q4_.[0-9]$", $key)){
$Q4score[$i] = $value;   
}
print $key.": ".$value."";
$Score[$i] = $value;
}
 
$i++;
}
print 'Q4: '.array_sum($Q4score); - Returns 0
print 'Total: '.array_sum($Score); - Returns correctly

Is my ereg() wrong?
My understanding is ereg("^Q4_.[0-9]$", $key) should look for a $key
starting with 'Q4_' followed by a single number and place those values
into an array named $Q4scores.

What am I missing?

Thanks,

alex hogan

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



Re: [PHP] problem with header("Location:home.php")

2004-09-09 Thread Alex Hogan
> Warning: Cannot modify header information - headers already sent by
> (output started at E:\PHPMySql scripts\bugtrack\connection.php:3)
> in E:\PHPMySql scripts\bugtrack\index.php on line 117
> 
> the connection file I have included in every page.
> why this error is occuring?

You are getting this error because you have header output starting at
line 3 in file connection.php.

The warning is stating that the function, 'header("location:
home.php");' cannot fire because you have started outputing header
information.

Your header() call is on line 117 of index.php.

Header() can only be used if there has been no header information sent
to the page.

You will need to see what is on line 3 and probably line 2 of connection.php.



alex hogan

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



Re: [PHP] Timing on an internal email

2004-09-08 Thread Alex Hogan
> Not necessarily outside of php, but outside of webserver. You need to
> setup a cron job that will execute the phpmailer script.

Gotcha..,

My webserver is a windows box, so I can just run a task schedule and give it;
php.exe myfile.php
and that should do it?

Would it be more efficient as a command line task or as an instance of
the browser?



alex hogan

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



[PHP] Timing on an internal email

2004-09-08 Thread Alex Hogan
Hi all,

I want to set up a delivery date and time for emails to be sent. (I'm
using phpmailer)

I'm coming up blank on how to do this.  I thought that I could put a
timing condition on a page that I know will be accessed daily that
would look for the date then call the function that will do the mail
outs on the appropriate date, but there has to be a better way.

Is this something that I'll have to do outside of php?


alex hogan

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



Re: [PHP] class packages

2004-09-08 Thread Alex Hogan
> You suggestion about the config file is interesting, but while I go and
> re-read your post, I am wondering how you would avoid class name conflicts.

I try to avoid using the same name for different classes.

> Point and case, the only reason I am going after packages is because I have
> a search class that is used for something else, and I want to not have to
> name my other class "SearchHelp".

Are there extensive differences between the two classes?

Could you extend the search class and get the same results?

You could name the two classes the same and call them using the same
name but call two differnent files.  I've never done that but I don't
see why it wouldn't work.

> I am going to run into conflicts if I include two class definitions for
> search, am I not?

Yep. If you call them both at the same time.



alex hogan

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



Re: [PHP] class packages

2004-09-08 Thread Alex Hogan
> Do you define the class?:
> 
> class help.Search {
> }

No..,

In your example you are defining the search class in the Help
namespace, just like you would in ActionScript.

I don't think you can do that in php.  
You would just use;
class Search{
  // do stuff here
}

You can extend the class using;

class subSearch extends Search{
  // do stuff here
}



alex hogan

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



Re: [PHP] class packages

2004-09-08 Thread Alex Hogan
> > It seems the following is the best option:
> > include('classes/help/Search.inc');
> >
> > // Inside Search.inc and in the same "package"
> > include('OtherClass.inc');
> > include('AnotherClass.inc');
> >
> > Is there a better way?

I do pretty much the same thing but with a config.php file.

I have in my directory structure a configuration file that will
override the current config file settings when the contents changes
depending on the requirements of the directory.  So in my directory
that processes email I have a config.php file that will include the
class files necessary for the email functionality.  In the admin
section I have a config.php file that includes the admin
authorization, editing and insertion, and modification class files.

I don't know if it's a right way or wrong way.., it just seemed to
make sense to do it like that.


alex hogan

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



Re: [PHP] Dynamic Class Methods

2004-09-07 Thread Alex Hogan
[snip]
I can think of some good reasons -- the one that readily leaps to mind
is a plugin architecture.
[/snip]

OK.., Duh.., that hit me like a brick.  It may take some time but
eventually the light will come on. ;-)

I don't know why but, plugins never crossed my mind in php
development.  Until now I've always thought of plugins as purley
client side development.




alex hogan

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



Re: [PHP] Dynamic Class Methods

2004-09-07 Thread Alex Hogan
> Keep in mind the above is still in beta, but will allow you to
> add/remove/redefine methods of objects at runtime. 

You'll have to excuse me form my ignorance, but why would you want to
add, remove or redefine methods of objects at runtime?

I understand object overloading, but are you talking about something else?



alex hogan

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



RE: [PHP] Regex for Validating URL

2004-09-03 Thread Alex Hogan
> Just to be pedantic, that would be pedantry ;) !

Is this thread ever going to die?  Or would that be dye? ;)



alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



[PHP] Protected vars

2004-08-17 Thread Alex Hogan
Hi All,

I am having a hard time connecting to a mssql db from within a class.  I
keep getting this error;
Warning: mssql_connect() [function.mssql-connect]: message: Login failed
for user 'SERVER\IUSR_SERVER'. (severity 14) in
G:\wwwdev\includes\dbclass.inc.php on line 20

$this->dbh  =   mssql_connect($this->dbhost,
$this->user, $this->pass);  //Line 20

Which indicates that he's not receiving the connection values.

In the declarations of the class I have;
protected $user;
protected $pass;
protected $dbhost;
protected $dbname;
protected $dbh;
protected $config_file  =   'config.inc.php';

And in the __constructor I am calling the config file.
include_once($this->config_file);
$this->user =   $user;
$this->pass =   $pass;
$this->dbhost   =   $dbhost;
$this->dbname   =   $dbname;

If I change it to pass values into the constructor and remove the call
to the config file from the class and put it in the file that
instantiates the class I get the same error.

If I assign the values to the vars on declaration then it works.  It is
my understanding that if a var is protected then it is used only in that
class and subclasses but not by class users.  This explains why when I
try to pass the values to the constructor it threw that error.  But why
can't I assign the values to the vars from inside the constructor by
including the config file?  Oddly enough when I debug the file I don't
get anything that indicates that it won't parse the class.

 

alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] [discuss] Rename this list

2004-08-12 Thread Alex Hogan

> Imagine all the people that'll want to post to a John Holmes list!!!

People would be wide open for that list.

Sorry.., I couldn't resist... Just had to take the low road...



alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] Escaping quotes [solution]

2004-08-12 Thread Alex Hogan
[snip]
2) By not escaping quotes in the data
...
You can do it this way but you must make sure that any strings in your 
values array have been escaped before with 
[/snip]

There is no quotes in the data.  The data coming in is a $_POST array.
$dbmssql->dbinsert($_POST, $table);

However this did make me pull my head out of my...

[snip]
using str_replace("'", "''",$str) should work.
[/snip]

Justin's first post on PEAR::DB pointed me in the right direction.  The
initial method that parses out the $_POST is where I needed to add the
quotes around the values.
I sure will be glad when I don't make these kinds of simple mistakes
anymore.


Thanks guys...


alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



[PHP] Escaping quotes

2004-08-11 Thread Alex Hogan
Hi All,

I have this expression;
$query  =   "INSERT INTO $table (%s) VALUES (%s)";
$query  =   sprintf($query, implode(",", $fld), implode(",",
$val));
$result =   mssql_query($query) or die($errmsg); 
I am trying to insert values from an array into the database.
I keep getting the error that I can't pass column names in this context.
I know it's because I'm not enclosing $val in quotes.  
I've tried a number of variations;
implode("\"","\"", $val)
implode("\',\'", $val)
implode(",", "\"".$val."\"") - This blows up nicely ;-)

Where am I going wrong on this?


alex hogan

 

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] PHP performance

2004-08-10 Thread Alex Hogan

> Did you try a curveball when throwing the processors into the box?

Processors like sliders...
Can't lay off 'em.., can't hit 'em. 


alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] Cannot redeclare function

2004-08-10 Thread Alex Hogan
[snip]
> Well, it's very likely that that file was being included 
> twice. You just can't do an include() on the same file twice 
> if it defines functions or classes. Look through your code 
> and see all of the places where the include was happening. 
> Perhaps the file that includes that file is being included twice.
[/snip]

I checked that.  I have all the includes at the top of the page only
being brought in from a config file.
I checked the config file for that directory and it only calls the files
once.  No duplication.
I even checked the classes to insure that there wasn't any duplicate
functionality or duplicate calls.

Apparently I must've been calling it from someplace else that I can't
find, and changing to include_once() fixed the problem.  I just don't
understand why it worked for as long as it did before now.


alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] PHP performance

2004-08-10 Thread Alex Hogan

[snip]
>  I figured PHP's memory limit per script at 8mb might be the 
> bottleneck, so I upped it to 128, restarted apache, and reran 
> the script.  Increasing available memory had no effect.
[/snip]

This may have already been addressed, but did you index any key fields?




alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] Cannot redeclare function

2004-08-10 Thread Alex Hogan
> Did your error_reporting level change with the upgrade? This 
> was more than likely silently ignored with PHP4 and now 
> showing as a warning/error in PHP5 or just dependent upon 
> your error_reporting level.

No..,

I was careful to set 5 up with as many of the same settings as the
previous version.  I only had half a day to change the production
environment so I wanted to make sure there was no lag.  Unless there was
something that I missed.

At first I thought that I had either duplicated the function someplace
else, but that wasn't the case.


alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



[PHP] Cannot redeclare function

2004-08-10 Thread Alex Hogan
Hi All,


I have a registration page that hasn't changed in several weeks.  Today
it decided to freak-out by throwing an error;
'Cannot redeclare myfunctionname() on line 10 of myfunctions.inc'

Nothing has changed in either the calling page, or the function.  The
only thing that has changed since these files were put into production
is the upgrade on php to 5.

I've looked through the release notes and found nothing.  I looked
through the manual and found nothing that I can really put my finger on.
I was able to correct the problem with changing the 'include()' to
'include_once()', but I really want to know why this happened and why it
didn't throw that error until now.


alex hogan

 

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] Branching blunder

2004-08-05 Thread Alex Hogan
 
[snip]
> Because $answers = 5; is the last check of $answers unless 
> the else statement is invoked. Try this...
[/snip]

That was it.., I don't know why I didn't see that.


Thanks Jay.


alex
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] javascript type cast OT

2004-08-03 Thread Alex Hogan
[snip]
Perhaps we need a:

Subject: [Elite Guide] for the seasoned php poster.

Post everyweek :)

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!
[/snip]
 
I don't care who you are that's funny right there - ;-)
 
 
alex

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*


RE: [PHP] javascript type cast

2004-08-03 Thread Alex Hogan

> All I have to say is, sorry I asked.

OK.., now you're really making me want to take a poke at you.

You posted off topic, knew it was off topic, you got spanked for it.



Don't make things worse by whining.



alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] javascript type cast OT

2004-08-03 Thread Alex Hogan
> Hmmm, you should see the C++ newsgroup(s).

Point taken...

> Common and well established list courtesies established years 
> ago are expected to be suspended herewhy? 

Nope and that's wasn't my point.  My point was temperance.

> Having said that I suppose that those of us who are curt and 
> condescending (of which I am one) can shut up or go somewhere 
> else, which we have been asked to do several times. I was 
> just here to learn and to help where I could.

And I will be the first to admit that you have been one of the people on
this list that has answered every one of my questions, no matter how
stupid they have been. (And there has been some real boners)

However there is a difference between list courtesy and blatant
aggression.  I understand that there are going to be more newbie's to
programming here than on most language lists.  Does this mean that they
don't get the same consideration that those get who it is apparent that
they have been hacking code for a while?

This is a general list.


alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] javascript type cast

2004-08-03 Thread Alex Hogan
I have been on a number of lists over the years, as what ever technology
I'm using at the time has demanded.

I would have to say that this list is one of the most curt and
condescending lists I've ever been on.  Perhaps it's because the long
time users don't realize they're being so, (unless of course you read
the FAQ about asking smart questions which they are so happy to throw at
you), or maybe it's because they are so much better at this particular
technology that they don't have to even be civil.

What ever the reason it leaves a bad impression for anyone embracing php
and wanting to gather additional information that can sometimes only be
obtained from an individual with experience and not a book. (imagine
that)

Now I fully expect that some one will come back and say something like,
"Well you don't have to stay on this list" or something equally as
moronic.  Quite frankly I don't care.  Flame away...

Over the last seven months that I have been on this list I have seen the
same questions addressed several times.  Sometimes worded different, but
nothing really new.  Maybe that is what creates such animosity to the
newer members of this list from the older ones.  Then again maybe it's
nothing more than the age old trait of chastising someone else to give
themselves a feeling of importance.

My point is a little temperance goes a lot farther and shows a lot more
than self importance.



BTW.., Yes I'm top posting so go ahead and flame away for that too.

alex hogan


> -Original Message-
> From: Vail, Warren [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, August 03, 2004 12:38 PM
> To: 'Jason Wong'; [EMAIL PROTECTED]
> Subject: RE: [PHP] javascript type cast
> 
> I, for one, am not convinced that this all that far off topic.
> 
> Since the accepted method to generate browser interaction 
> with server side PHP, is to use Javascript, it doesn't seem 
> any more off-topic than dealing with database questions about MySQL.
> 
> I am probably like most PHP developers, with a very weak 
> knowledge of Javascript, and while that makes the question 
> "feel" like being off-topic, I'm not sure it should be.  I 
> wish I knew of another list I could recommend as a resource 
> for Javascript, but I don't, and that is probably a result of 
> knowing so little.
> 
> Only abuse occurring here, IMHO is the content police's 
> treatment of Josh.
> 
> Warren Vail 
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



[PHP] Array assistance

2004-07-27 Thread Alex Hogan
Hi All,
 
I have a page where I'm collecting answers from a series of questions.
The questions are entered into the array one at a time so I can keep
track of paging.
$arans  =   array($_POST);
$_SESSION['arans'][$pageid] = $arans;

Then I want to check the sum of the array for scoring purposes. However
I have to get to the key that has the values for the scores.

for($i = 1; $i <= 10; $i++){
print_r($_SESSION['arans'][$i]);
print"";
}

Give me this...
 
Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) ) 
Array ( [0] => Array ( [mc] => 10 [Submit] => Submit ) ) 
Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) ) 
Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) ) 
Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) ) 
Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) ) 
Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) ) 
Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) ) 
Array ( [0] => Array ( [mc] => 10 [Submit] => Submit ) ) 
Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) )

Ten separate arrays with an array at 0 that has the data I'm after.
This is where I'm getting stuck.  How can I get to the keys that are
either 'mc' or 'truefalse' and sum them?

Thanks,

alex hogan

 

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



[PHP] INSERT INTO using foreach

2004-07-23 Thread Alex Hogan
Hi All,
 
I have a form with several values to insert.
I thought that I remember a thread that discussed using a loop to insert
$_POSTed values.
I am trying;
 
foreach($_POST as $key => $value){
  if($key == 'Submit'){
  exit;
 }
 else{
  $sql = "INSERT INTO registration ('$key')
  VALUES ('$value')";
  $result = mssql_query($sql);
 }
}
 
I keep getting an invalid object 'registration' error.  However
registration is the name of the table.  I'm guessing it's someplace else
in the statement that I'm messing up on.
 
 
 
alex hogan

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*


[PHP] Function with Optional Arguments

2004-07-21 Thread Alex Hogan
Hi All,
 
How do I write a function with optional arguments?  Is it possible in
php?
 
function myfunc($First, $Second,[$Third, $Fourth]){
some stuff here
}
 
 
 
alex hogan

 

 

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*


RE: [PHP] Limitation to URL params on Include()?

2004-07-14 Thread Alex Hogan
[snip]
> ...
> $block=new Block($header,$content,$link,$andsuch);
> $block->display();
> ...
[/snip]

That's very cool...

Thank you...



alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] Limitation to URL params on Include()?

2004-07-14 Thread Alex Hogan
Thanks James,

> I'm going on the assumption that since you're using a URL 
> parameter in the include, you have fopen_wrappers enabled,

Yes
 
> and the URL is external to your current site. Otherwise you'd 
> just be doing a file system based include.

No, the url is on my site...

I have a file named block_content.php that is nothing more than a
display block with graphics for effect.
Instead of making several different display files I want to use a single
one and just assign a different value to the variables $header,
$content, $link.., and such.  Then I can have as many of the content
blocks on the same page as necessary to display content summaries.

If I am headed in the wrong direction please let me know.

> What are you trying to do? Pull the code of a php script into 
> your script, or display the HTML output of a web page 
> embedded in existing content?

Display HTML output.

> If you're trying to display the contents of another web page 
> within your own, you may want to look at readfile(), read(), 
> fopen() or even make a direct HTTP call to the server using 
> sockets. Readfile() will read and output the HTML generated 
> by the called page. read() and
> fopen() will get the output of that page and make it 
> available to you for your own processing.

OK...

alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



[PHP] Limitation to URL params on Include()?

2004-07-14 Thread Alex Hogan
Hi All,
 
Is there a limit to the number of url parameters(other than the 256
limit) that you can have on a file that you are including?
I have a file that I'm calling..,
include('http://mydomain.com/block_display.php?id=1&ttl=1011&cnt=268&lnk
=129&prv=202');
where the parameter values are record sets.
 
What happens is that I get the first three params and then nothing.
 
Any ideas?
 
alex hogan

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*


[PHP] Vienna anyone

2004-07-14 Thread Alex Hogan
Does anyone on this list live in Vienna?
 
If so please contact me off list. 
 
 
alex hogan

 

 

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*


RE: [PHP] PHP Hosting

2004-07-09 Thread Alex Hogan
> Don't you require Windows 3.1.11 for proper network support 
> :) - at least 3.1 was stable.

Poke fun all you want..,

Everyone knows the real OS was Warp! ;-)


*onward flamewar soldiers*


alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



[PHP] Getting Server time

2004-06-10 Thread Alex Hogan
When I'm using the time() function am I getting the time on the server?
If not how can I get the time from the server regardless of whether or
not its in the same time zone as the client.
 

alex hogan

 

 

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*


[PHP] Strtotime() weirdness

2004-06-01 Thread Alex Hogan
Does anybody know of any peculiarities in the strtotime() function?
 
If I enter any date before 1 Jan 1970 I get a -1 returned.
 

 

alex hogan

 

 

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*


RE: [PHP] Online Testing Application

2004-06-01 Thread Alex Hogan

> The main page that I am trying to design a page which will 
> tell a user, what lessons he/she has passed, what lessons he 
> /she is eligible to take and the lessons he /she cannot take 
> at the moment. The lessons are numbered sequentially like 
> Lesson 101, 102, 103, 104, 105 , 106 110. Out of them 
> e.g. only Lesson 101 and 104 are CORE requirements, the rest 
> are just electives. However a person cannot do Lesson 106 
> (which is an elective ) till he /she has passed Lesson 104.

I use a prereq table that contains lesson ids and the associated
prereqs.  When a student meets the minimal requirements for the
prerequisite course then they are given access to the additional or sub
sequential courseware.  This will show up in their login area of the
LMS.

I would suggest that you make everything as modular as possible, all the
way down to the ELOs.  This way you can reuse any learning objective
logic that you used in a previous lesson.  All  you have to do is
re-associate the content.  Most of the problems I have run into is the
IDs either don't think large enough, which is evident in the way the
course seems disjointed, or they don't think small enough, they worry
too much on the lesson and not enough on the objectives that make up the
lesson and how they can be made into expressions that will transcend
lessons, courses, etc...




alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



RE: [PHP] making selection in drop down

2004-05-28 Thread Alex Hogan

> Use HTML attribute "selected" in the option field you want to 
> set as default...

Yes.., thank you.., however I am more interested in how to force that selection to a 
specific option tag in the dropdown from a search.  If I'm missing your point please 
excuse me.  I'm a little brain dead this morning.

If I have something like this what I'll want to do is to identify the point in the 
array where I can force the selected to be the default based on the previous search.


>Make Selection
$n";
}

?>

Is there a better way of doing this?




alex hogan

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



[PHP] making selection in drop down

2004-05-28 Thread Alex Hogan
Hi All,
 

How can I force a selection on a drop down from a value in a database?

I have a drop down that contains locations.  These locations are
contained in a table.  When a search is completed the results are
displayed and I want to be able to use that same drop down and just
force the selection to the appropriate location.

 

alex hogan

 

 

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*


RE: [PHP] 0 == null ?

2004-05-10 Thread Alex Hogan
> Does 0(zero) really equate to null?
> 
> if( 0 == null )
> {
>   echo 'true';
> }
> else echo 'false';
> 
> Result echo's: true
> 
> This can not be right, can it?  I have never heard of such a 
> thing.  As far as I recall from any language null is of no 
> value equaling nothing?
> So how can it equal 0?

You can use is_null instead.

If(is_null($var)){
    do something
}
Else{
do something different
}



alex hogan


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Creating an assoc array from two arrays

2004-04-23 Thread Alex Hogan
Hi All,

I am looking through the manual and I think I may be blind or something, but
how can I create an associative array from two arrays.
What I have is two arrays that look like this;

Array1([0]=>Spider, [1]=>Monkey, [2]=>Cards)
Array2([0]=>26.3, [1]=>0.65, [2]=>62.07)

I want to combine them into;

ArrayCombined([Spider]=>26.3, [Monkey]=>0.65, [Cards]=>62.07)

So I can compare it to a third array.

TIA

alex




** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Logic problem

2004-04-20 Thread Alex Hogan
> What's in your array?

$array1[0] = 'firstname';
$array1[1] = 'lastname';
$array1[2] = 'tkt_title';

I got that fixed.

Thanks.


alex hogan



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Logic problem

2004-04-20 Thread Alex Hogan
[snip]
I do have one question though.  I ran your code and it only returns the
first letter for that element in the array.  For instance fieldone returns
as f and tableone returns as t. The output looks like this; SELECT f,f,f
FROM t,t.
[/snip]

Never mind I found it.  It should be;
$query = "SELECT ";
$start = true;
$i = 0;
foreach ( $array1 as $flds ) {
if ( $start ) {
$query .= $flds;
$start = false;
} else {
$query .= ", " . $flds;

}
}
$query .= " FROM ";
$start = true;
$n = 0;
foreach ( $array2 as $tbls ) {
if ( $start ) {
$query .= $tbls;
$start = false;
} else {
$query .= ", " . $tbls;
}
}

Thanks John, you saved me hours of work.


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Logic problem

2004-04-20 Thread Alex Hogan
[snip]
> $query = "SELECT ";
> $start = true;
> foreach ( $array1 as $flds ) {
>   if ( $start ) {
>   $query .= $flds[$i];
>   $start = false;
>   } else {
>   $query .= ", " . $flds[$i];
>   }
> }
> $query .= " FROM ";
> $start = true;
> foreach ( $array2 as $tbls ) {
>   if ( $start ) {
>   $query .= $tbls[$n];
>   $start = false;
>   } else {
>   $query .= ", " . $tbls[$n];
>   }
> }
[/snip]

I gotcha..,

I do have one question though.  I ran your code and it only returns the
first letter for that element in the array.  For instance fieldone returns
as f and tableone returns as t.
The output looks like this;
SELECT f,f,f FROM t,t.


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Logic problem

2004-04-20 Thread Alex Hogan
Hi All,

I am having a logic problem. (insert jokes here)  I am trying to create a
function that will allow me to pass any number of fields and tables into a
blanket query.

I am getting an error; Unexpected foreach.  I have tried placing the loop in
several different places and am getting the same error.

What should I be doing differently?

Here's my code;

function myselect($array1, $array2){
$i  =   0;
$n  =   0;
$query  =   "SELECT".foreach($array1 as $flds){
$flds[$i];
}.
"FROM".foreach($array2 as $tbls){
$tbls[$n];
}.;
$result =   mssql_query($query);
print   "
";
$j  =   0;
while($row  =   mssql_fetch_array($result)){
$fields =   $row[flds[$j]];
print   "".$fields."";
}
}


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] ADOdb Operator question

2004-04-08 Thread Alex Hogan
> If you're using ADOdb, what is the name, purpose, and function of this
> operator?
> 
> ->
> 
> e.g. $conn->Connect(false, 'scott', 'tiger', $oraname);
> 
> I can follow some tutorials, but I'm just not sure when I need to use it
> and
> when I don't.

This is an explanation that's in the manual.

$conn->Open("Provider=SQLOLEDB; Data Source=localhost;Initial
Catalog=database; User ID=user; Password=password");

http://www.php.net/manual/en/ref.com.php



alex hogan


> -Original Message-
> From: Gabe [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 08, 2004 1:43 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] ADOdb Operator question
> 
> If you're using ADOdb, what is the name, purpose, and function of this
> operator?
> 
> ->
> 
> e.g. $conn->Connect(false, 'scott', 'tiger', $oraname);
> 
> I can follow some tutorials, but I'm just not sure when I need to use it
> and
> when I don't.
> 
> Thanks
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Using WinNT login

2004-04-08 Thread Alex Hogan
Thanks guys...


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Using WinNT login

2004-04-08 Thread Alex Hogan
Hi All,

Is it possible to use the users WinNT network login for a php app?
If so can someone point me in the direction for a tutorial or directions.


Thanks,


alex hogan




** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Limiting an array to unique values

2004-04-06 Thread Alex Hogan

I guess I deserved that one...



alex hogan


> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 06, 2004 9:40 AM
> To: Alex Hogan; PHP General list
> Subject: Re: [PHP] Limiting an array to unique values
> 
> From: "Alex Hogan" <[EMAIL PROTECTED]>
> > I have an array that I am using as a parameter for a query in a where
> > clause.
> >
> > The array has values that are like this.
> >
> > Item 1
> > Item 2
> > Item 3
> > Item 1
> > Item 3
> > Item 3
> > Item 1
> >
> > What I need to have is unique values only.
> >
> > Item 1
> > Item 2
> > Item 3
> >
> > How can I sort out the redundant values in that array?
> 
> array_unique(). Imagine that. :)
> 
> ---John Holmes...


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Limiting an array to unique values

2004-04-06 Thread Alex Hogan

Thanks...

Exactly what I needed.


alex hogan


> -Original Message-
> From: joel boonstra [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 06, 2004 9:30 AM
> To: PHP General list
> Subject: Re: [PHP] Limiting an array to unique values
> 
> On Tue, Apr 06, 2004 at 09:27:31AM -0500, Alex Hogan wrote:
> > Hi All,
> >
> > I have an array that I am using as a parameter for a query in a where
> > clause.
> >
> > The array has values that are like this.
> >
> > Item 1
> > Item 2
> > Item 3
> > Item 1
> > Item 3
> > Item 3
> > Item 1
> >
> > What I need to have is unique values only.
> >
> > Item 1
> > Item 2
> > Item 3
> >
> > How can I sort out the redundant values in that array?
> 
> PHP's 'array_unique' function should help:
> 
>   http://php.net/array_unique
> 
> --
> [ joel boonstra | gospelcom.net ]
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Limiting an array to unique values

2004-04-06 Thread Alex Hogan
Hi All,

I have an array that I am using as a parameter for a query in a where
clause.

The array has values that are like this.

Item 1
Item 2
Item 3
Item 1
Item 3
Item 3
Item 1

What I need to have is unique values only.

Item 1
Item 2
Item 3

How can I sort out the redundant values in that array?



alex hogan




** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Displaying a money datatype from mssql - Solution

2004-04-02 Thread Alex Hogan
Recap:
In the query I had;
SELECT totalamount

And it was returning;
Total Amount
5.41108926696E-309

I tried to modify the query to;
SELECT cast(totalamount as decimal(10,2)) as totalamount

And php gave me an error;
Undefined Index at line (x);

When I tried to use 'number_format($totalamount,2)' it returned;
Total Amount
0.00

Solution:
The solution was in the query;
SELECT cast(totalamount as numeric(10,2)) as totalamount

This returns the proper formatting;
Total Amount
123.50



alex hogan


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Displaying a money datatype from mssql

2004-04-01 Thread Alex Hogan
> [snip]
> My last resort would be to go into the db and do a conversion there but
> I
> really don't want to do that.
> How can I convert these to represent a readable dollar figure?
> [/snip]
> 
> start with http://www.php.net/number_format

I tried that and it converted the values to 0.00.  I know I'm missing
something simple in the conversion.

alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Displaying a money datatype from mssql

2004-04-01 Thread Alex Hogan
How do I correctly display a money datatype from a mssql db?

I've looked through the archives and come up empty, and google doesn't seem
to have anything worth mentioning.

My query is;

SELECT od.price, od.inventorycost, om.totalamount

FROM   orderhistorymaster as om, orderhistorydetail as od

WHERE  om.ordernumber = od.ordernumber and 
   om.customernumber = '$custnum' and
   od.entrydate = om.entrydate and om.entrydate between
   '$startdate' and '$enddate'

ORDER BY om.entrydate

When I run the query, for the fields 'price' and 'totalamount', I get a
return of;
Price
1.59149684322E-310

Total Amount
5.41108926696E-309

So I tried;
SELECT cast(od.price as decimal(10,2)), cast(od.inventorycost as
decimal(10,2)),  cast(om.totalamount as decimal(10,2))

But php didn't like that.

In Query Analyzer they come up;
Price
.7500

Total Amount
25.5000

My last resort would be to go into the db and do a conversion there but I
really don't want to do that.
How can I convert these to represent a readable dollar figure?

alex hogan


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] CGI Error

2004-03-23 Thread Alex Hogan
Hi All,

I am getting this error when I trying to pass some url params;

CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:

And nothing

Has anybody seen this before?  I did a search and it seems that there are a
few references to it, but nobody seems to have an explanation.

alex hogan


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Parsing recordsets - only first row returned

2004-03-18 Thread Alex Hogan
> Wow... you're totally missing the point of a database when you store data
> like this.

Not my db...  

> So how many times does the while() loop execute?

Once

>How many rows is your query actually returning?

Just one.

>What does the output actually look like and what should it look like.

9
8
9
...

It should produce an average.

7.36
8.01
...



alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Parsing recordsets - only first row returned

2004-03-18 Thread Alex Hogan
> thanks for all the white space. one blank line isn't enough for my brain
> to properly separate the different parts of your email. but now, thanks
> to your extra white space i don't have a headache anymore. thanks again!
> it really helps!

Anything I can do.., just a little present from MS Outlook.  Glad to hear
your headache is gone though.

> $entire_recordset = mssql_fetch_array($result);
> 
> foreach($entire_recordset as $row)
> {
> // looping code goes here
> }

Thanks...


alex hogan


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Parsing recordsets - only first row returned

2004-03-18 Thread Alex Hogan
Hi All,

 

I am parsing data returned from a field that looks like this;

 

6-8-3-5-10-9-6__7-5-9--etc...

 

The code below parses out the data they way I want it but only returns the
first row.  I need to compare all rows and return an average from each of
the parsed out numbers.  Where have I made a mistake?

 

$i = 0;

$total = array();

while($row = mssql_fetch_array($result)){

$thearray = explode('__', $row[$i]);

$n = 0; 

foreach($thearray as $topelement){

   foreach(explode('--', $topelement) as $element){

if(is_numeric($element)) {  

$total[$n] += $element;

echo $element;

$n++;

}

}

$i++;

}

$avg = array();

$num = count($total);

for($x = 0; $num > $x; $x++) {

$avg[] = $total[$x] / $i;

echo "";

echo $avg[$x];

    }

}

 

Thanks,

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Array to String conversion error

2004-03-16 Thread Alex Hogan
> $row is an entire array. you don't explode an entire array, you only
> explode the contents of an element of an array.
> 
> print_r($row) will give you some clues.
> 
> you'll need to access a specific element within the array. like:
> 
> $thearray = explode('__', $row[0][0]);

That was it... Thanks Chris.


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Array to String conversion error

2004-03-16 Thread Alex Hogan
Hi All,

 

I have a function that gets a single field from a mssql db. That field
contains data that is then parsed out to represent a survey's results.

 

The function;

function quesresults(){

$query = "SELECT sur_ans

   FROM au_survey";

$result = MSSQL_QUERY($query) or die("Can not execute query
$query. ");

$row = mssql_fetch_array($result);

$thearray = explode('__', $row); - This is line 40

$i = 1;

foreach($thearray as $topelement){

foreach(explode('--', $topelement) as $element){

echo $element;

echo "";

}

echo "question $i"; 

echo "";

$i++;

}

}

 

When I call the function I get;

Notice: Array to string conversion in \WWW\mypath\srvyclass.inc.php on line
40
Array
question 1

 

What am I missing?

 

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Re: Loosing redirect in if...else

2004-03-12 Thread Alex Hogan
> (a) if you're using any values sent via the URL string (e.g.
> cf=0), you need to
> use $_GET, not $_POST;

Some of the information is coming from a form and the info from the url is
to call the different questions.  They are all on one page in a switch
statement.

> (b) empty() will also evaluate to true if the value of the variable 
> is zero.

That's right I forgot about that.  Thanks.



alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Loosing redirect in if...else

2004-03-11 Thread Alex Hogan
>$_SESSION['selloction'] = '0';
>
>1) Are you sure you don't have a typo above?

I checked the code and it's just in this post.  Fat finger day.

> If you want to set a session variable (and keep it set) when you do a
> redirect
> you need to the close the session first.


Thanks...,


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Loosing redirect in if...else

2004-03-11 Thread Alex Hogan
Hi All,

 

I know this may be a bad time..., that whole top posting vs. bottom posting
debate has got me riveted, (especially after getting a monitor full the
other day), but I have a question.

 

I have a page that displays a survey.  11 questions all separated in a
switch statement on a page named "cf_survey.php". (please don't start, it's
how I decided to do it)

 

On each question there is a main question with a choice of 1 to 5 on links,
then a sub question with a text area.

 

The code below works well to check to insure that the users selected a
location from the dropdown in case default.

 

case 1:

 

if(empty($_SESSION['sellocation'])){

$_SESSION['selloction'] = '0';

}

$_SESSION['sellocation'] = $_POST['sellocation'];


if($_SESSION['sellocation'] == '0'){

$errormsg = true;

?>



redirect('cf_survey.php?cf=0');





 

This seems to be where I run into trouble.

 

When the user selects the main question choice and the page reloads I get an
error that the index 'sellocation' is not set.

 

If I change the expression to something like this;

 

if(empty($_SESSION['sellocation'])){

$_SESSION['selloction'] = '0';

}

else{

$_SESSION['sellocation'] = $_POST['sellocation'];


if($_SESSION['sellocation'] == '0'){

$errormsg = true;

?>



redirect('cf_survey.php?cf=0');





RE: [PHP] Screen Res

2004-03-11 Thread Alex Hogan
> I am trying to get the users screen res into a var for php. And I have
> the Javascript that gets the screen res. But when I try to put that into
> a var, it puts it in as a string, storing the javascript code instead of
> the results of that code. Is there a way to fix this?

Here is a link that explains taking javascript vars and putting them into
php vars.

http://www.iwdp.co.uk/javascript_to_php.htm


HTH,

alex hogan


> -Original Message-
> From: res0b8b6 [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 10, 2004 10:58 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Screen Res
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] mssql_data_seek offset error

2004-03-09 Thread Alex Hogan
> That cured 9 but it still freaks on 10.  It returns the error for the
> entire
> loop count.
> [/snip]
> 
> Because $paging might be turning the integer you need into text? Maybe?

I found it.

In that sql statement I'm using SELECT DISTINCT
In the sql statement that I'm using to get my record count I'm using SELECT
Count(fieldname).

When I review the records I see that there are some that are duplicated.

Oopsee.

Thanks for the help... and I promise not to top post again

Beware the wrath of Blanchard!

alex 


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] mssql_data_seek offset error

2004-03-09 Thread Alex Hogan
> Try this 
> 
> $query = "SELECT DISTINCT q.questions
> FROM SG_Questions as q, SG_QuesRef as r
> WHERE r.pos_id = '$pos' AND r.sic_id = '$sic' AND
> r.cat_id
> = '$cat' AND r.ques_id = q.ques_id";
> $result = mssql_query($query) or die("Can not execute query $query. ");
> 
> $i =1;
> 
> for ($i = $paging; $i < $paging + $limit; $i++){
>   $cnt = mssql_data_seek($result, $i);
>   $row = mssql_fetch_array($result);
> }

That cured 9 but it still freaks on 10.  It returns the error for the entire
loop count.

I don't get it.


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] mssql_data_seek offset error

2004-03-09 Thread Alex Hogan
> What does mssql_num_rows($query) return?

105


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] mssql_data_seek offset error

2004-03-09 Thread Alex Hogan
[snip]
> There is your problem. Return ALL of the records, then use
> mssql_data_seek to move about.
[snip]

OK, I'm returning all the rows and no change.

Code:
$query = "SELECT DISTINCT q.questions
  FROM SG_Questions as q, SG_QuesRef as r
  WHERE r.pos_id = '$pos' AND r.sic_id = '$sic' AND r.cat_id
= '$cat' AND r.ques_id = q.ques_id";
$result = mssql_query($query) or die("Can not execute query $query. ");

for ($i = $paging; $i < $paging + $limit; $i++){
$cnt = mssql_data_seek($result, $i);
    $row = mssql_fetch_array($result);

...etc...



alex hogan


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] mssql_data_seek offset error

2004-03-09 Thread Alex Hogan
>PLEASE STOP TOP POSTING!

Sorry Didn't mean to don't even know exactly what it is

 

> Are you selecting all of the records at once, or just a few at a time?

I am returning a few records at a time.

 

 

alex hogan



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] mssql_data_seek offset error

2004-03-09 Thread Alex Hogan

There are 10+ rows of data.

Actually I should say there are over 100 rows of data returned and broken up
into sets of 10 records each. (approx. 103 total records)



alex hogan


> -Original Message-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 09, 2004 2:52 PM
> To: Alex Hogan; PHP General list
> Subject: RE: [PHP] mssql_data_seek offset error
> 
> [snip]
> I am using mssql_data_seek() to move the cursor to a particular row for
> paging.
> 
> $cnt = mssql_data_seek($result, $i);
> 
> This works fine until the variable $i reaches a value of 9 and seemingly
> higher. (at least 10, I haven't gone higher)
> 
> Then I get this error;
> 
> mssql_data_seek(): Bad row offset in [snip] on line: x
> 
> The line in question is the one above.
> 
> Why does it work fine until it reaches 9?
> 
> Why can't the offset go above 8?
> [/snip]
> 
> How many rows of data do you have? I would have to bet 9 rows.


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] mssql_data_seek offset error

2004-03-09 Thread Alex Hogan
Hi All,

 

I am using mssql_data_seek() to move the cursor to a particular row for
paging.

 

$cnt = mssql_data_seek($result, $i);

 

This works fine until the variable $i reaches a value of 9 and seemingly
higher. (at least 10, I haven't gone higher)

 

Then I get this error;

mssql_data_seek(): Bad row offset in [snip] on line: x

 

The line in question is the one above.

 

Why does it work fine until it reaches 9?

Why can't the offset go above 8?

 

I searched google and came up with several of the top hits that had this
very error on their pages.  Very nice....

 

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Pagination & MSSQL

2004-03-09 Thread Alex Hogan
Hi All,

 

I have searched for some references on pagination using mssql but have come
up empty.

 

I have looked at the tutorials on Zend and just about everywhere else but
unfortunately they all use LIMIT in the sql statement and the closest thing
to that in mssql is either TOP n, or SET ROWCOUNT which does me no good.

 

My thoughts were to bring in all the recordsets and parse through them line
by line to only show the ones that I want for the page that is displayed.
Part of my solution is below but I kekep getting this error;

 

Parse error: parse error, unexpected ')', expecting ';' in
D:\WWW\scriptgen\pagination_test.php on line 25

 

This is the code;

 

$limit = 10;

for ($i = 0; $i < $limit; $i++){ -- This is line 25

$name = mssql_result($i);

if($bgcolor == "#F2F7FF"){

$bgcolor = "#FF";

}

else{

$bgcolor = "#F2F7FF";

}

echo "$name\n";

}

 

Something wrong with my syntax?

 

 

alex hogan

 

P.S.  OP is original poster isn't it, damn..., I need to start drinking
decaf.



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Variables inside a function

2004-03-08 Thread Alex Hogan
My mistake.

Good one on the spelling I can't believe I missed that one....


alex hogan


> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 08, 2004 12:26 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Variables inside a function
> 
> On Tuesday 09 March 2004 02:03, Alex Hogan wrote:
> > If I read his post correctly he was looking to make blah() available and
> > not $blah.
> 
> The OP says "so that I can use $blah anywhere in the script?", which to me
> means that $blah needs to be global ...
> 
> [snip]
> 
> > Of course obviously being one of the OP you refer to I have read the
> manual
> 
> (OP doesn't mean you)
> 
> > > Variables > Variable scope.
> 
> ... hence the referral to the manual.
> 
> >  In this case I don't see how it related to
> > his post, even though he stated that he was trying to echo $blah
> 
> According to what he stated he was trying to do it is very relevant.
> 
> > One of those letter of the law vs intent of the law sort of things.
> 
> Maybe.
> 
> > But thanks for the condensintion...,
> 
> I'm sorry if you interpreted my terseness as being condescending -- note
> the
> spelling (*now* I'm being condescending!).
> 
> > maybe I can return the favor sometime.
> 
> TIA ;)
> 
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Consultation, n.:
>   Medical term meaning "to share the wealth."
> */
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Variables inside a function

2004-03-08 Thread Alex Hogan
If I read his post correctly he was looking to make blah() available and not
$blah.

In my mind that meant that he would be calling his function named blah not
the variable.

Then if he called the function blah he would get the value of $blah inside
his function.

Of course obviously being one of the OP you refer to I have read the manual
> Variables > Variable scope.  In this case I don't see how it related to
his post, even though he stated that he was trying to echo $blah

One of those letter of the law vs intent of the law sort of things.

But thanks for the condensintion..., maybe I can return the favor sometime.


alex hogan


> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 08, 2004 11:49 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Variables inside a function
> 
> On Tuesday 09 March 2004 01:44, Alex Hogan wrote:
> > Don't you need to set a return?
> >
> > Return $blah;
> >
> > At the bottom of your function block.
> 
> That does not make the variable $blah available elsewhere in the program.
> The
> OP should take a look at manual > Variables > Variable scope.
> 
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Remembering is for those who have forgotten.
>   -- Chinese proverb
> */
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Variables inside a function

2004-03-08 Thread Alex Hogan

Don't you need to set a return?

Return $blah;

At the bottom of your function block.



alex hogan


> -Original Message-
> From: Nathan Croker [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 07, 2004 6:18 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Variables inside a function
> 
> I am relatively new to PHP. But something I can't seem to make work is
> when
> I call one of the functions I have made and a variable is set inside that
> function
> eg. function blah ($bl,$ah) {
> $bl++;
> $ah++;
> $blah=$bl+$ah;
> }
> I then echo $blah; somewhere else in the script but nothing is echo'd. How
> do I make it so that I can use $blah anywhere in the script?
> 
> Thank you in advance for any help.
> 
> Nathan Croker
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Re: php/mssql character limit?

2004-03-08 Thread Alex Hogan
Hi Ben,

The setting in the php.ini is;

mssql.textlimit = 4096

Reset that value to what you want.  I have mine set to 400.
Valid range 0 - 2147483647


alex hogan


> -Original Message-
> From: Ben Ramsey [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 08, 2004 10:30 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: php/mssql character limit?
> 
> I posted this message the other day, and no one has responded.  I'm
> replying to it to refresh it in the list.  I guess if no one responds or
> helps me out this time, then I'll just forget about it and let my client
> go unhappy.  ;-)  Seriously, if anyone can help me out, I would be much
> appreciative.
> 
> 
> Ben Ramsey wrote:
> > Anyone know of any kind of character limit in php or mssql (yes,
> > Microsoft SQL Server) for entering long text into a text column (of
> > around 4,055 characters in length--that's where it's cutting off)?
> >
> 
> --
> Regards,
>   Ben Ramsey
>   http://benramsey.com
>   http://www.phpcommunity.org/wiki/People/BenRamsey
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Returning only a row count of 1?

2004-03-05 Thread Alex Hogan

Yep..., it's Friday brain has left the building....



alex hogan


> -Original Message-
> From: Richard Davey [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 05, 2004 1:46 PM
> To: PHP General list
> Subject: Re: [PHP] Returning only a row count of 1?
> 
> Hello Alex,
> 
> Friday, March 5, 2004, 7:40:08 PM, you wrote:
> 
> AH> I have 6 records in this table but using this code;
> 
> AH> $querytotalcount = "SELECT COUNT(*)
> AH>   FROM CF_Survey";
> 
> AH> $totalrows = mssql_num_rows($resulttotalcount);
> 
> AH> I only return a count of 1.
> 
> It will only return 1 row because that's all you've asked it to return
> - a count of the number of records.
> 
> This is for MySQL but you'll get the idea:
> 
> $sql = "SELECT COUNT(*) AS hits FROM CF_Survey";
> $hits = mysql_result($result, 0, "hits");
> 
> Run your query directly in MSSQL and you'll see what gets returned.
> 
> --
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Returning only a row count of 1?

2004-03-05 Thread Alex Hogan

Dohhh,

Forget I asked



alex hogan


> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 05, 2004 1:43 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Returning only a row count of 1?
> 
> On Saturday 06 March 2004 03:40, Alex Hogan wrote:
> > I have 6 records in this table but using this code;
> >
> > $querytotalcount = "SELECT COUNT(*)
> >
> >   FROM CF_Survey";
> >
> > $resulttotalcount = mssql_query($querytotalcount) or die("Can not
> execute
> > query $insert_query. ");
> >
> > $totalrows = mssql_num_rows($resulttotalcount);
> >
> > I only return a count of 1.
> 
> Right, and what does that single row *contain* ?
> 
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Harp not on that string.
>   -- William Shakespeare, "Henry VI"
> */
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Returning only a row count of 1?

2004-03-05 Thread Alex Hogan
I have 6 records in this table but using this code;

 

$querytotalcount = "SELECT COUNT(*)

  FROM CF_Survey";

$resulttotalcount = mssql_query($querytotalcount) or die("Can not execute
query $insert_query. ");

$totalrows = mssql_num_rows($resulttotalcount);

 

I only return a count of 1.

 

Am I missing something?  I checked the manual and archives and have come up
empty.

 

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Necesito una función

2004-03-05 Thread Alex Hogan
If I understand you correctly I think you can use, getenv() of get the IP
address of the user.




alex hogan


> -Original Message-
> From: :: n a s s a t :: Depto Tecnico [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 05, 2004 8:02 AM
> To: php-ayuda
> Subject: [PHP] Necesito una función
> 
> En una news de www.php.net informan de que esta dirección se puede
> utilizar para pedir ayuda.
> 
> En ese caso, necesitaría saber, por favor, si existe una función para
> saber la IP desde la que se está accediendo a una página.
> 
> De no ser esta la utilidad de esta cuenta de correo, les ruego disculpen
> las molestias.
> 
> Muchas gracias.
> 
> Un saludo, Pepi García.
> Dpto. Programación.
> [EMAIL PROTECTED]
> www.nassat.com


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Re: Loop Oops....

2004-03-03 Thread Alex Hogan

Found it.

You were right, it was $question instead of $questions.

Many thanks.


alex


> -Original Message-
> From: Andre Cerqueira [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 03, 2004 9:34 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Loop Oops
> 
> probably, some of those $_SESSION['question#'] are unset, or arent
> arrays..
> 
> try:
> 
> foreach ($answers as $questions) {
>$question .= "__";
> 
>if (!is_array($questions))
>  continue;
>foreach ($questions as $subquestion)
>  $question .= $subquestion."--";
>}
> }
> 
> 
>  >$insert_query = "INSERT INTO SurveyTable
>  >(sur_ques_id, sur_ans, sur_num)
>  >VALUES (1, '$questions', 1)";
>  >
>  > $result = MSSQL_QUERY($insert_query) or die("Can not execute query
>  > $insert_query. ");
>  >
>  > The value in the db is either "Array" or part of the string but not
>  > the whole string.  I know the error is creating most of the problem.
> 
> you can only concatenate string with scalars (actually only strings, but
> php do some conversions...)
> if $questions is an array, you cant do that, and if its a string, you
> cant foreach it
> didnt you mean *VALUES (1, '$question', 1)"; ?
> 
> 
> maybe im missing something... but i hope this helps
> 
> 
> 
> Alex Hogan wrote:
> 
> > Hi All,
> >
> >
> >
> > I am having trouble with a nested loop and I can't seem to get it
> figured
> > out.
> >
> >
> >
> > I keep getting an error that states, Invalid argument on line 20.
> >
> >
> >
> > Here is the code;
> >
> >
> >
> > Sessions capture question answers that are multiple answers for each
> > question.
> >
> > $answers =
> >
> array($_SESSION['question1'],$_SESSION['question2'],$_SESSION['question3']
> ,$
> > _SESSION['question4'],
> >
> >
> >
> $_SESSION['question6'],$_SESSION['question7'],$_SESSION['question8'],$_SES
> SI
> > ON['question9'],
> >
> >
> $_SESSION['question10'],$_SESSION['question11']);
> >
> >
> >
> > I init the vars
> >
> > $question = "";
> >
> > $subquestion = "";
> >
> >
> >
> > Here's the loop I'm having trouble with.
> >
> > foreach ($answers as $questions) {
> >   $question .= "__";
> > foreach ($questions as $subquestion) { -- Here's the offending line
> --
> >   $question .= $subquestion."--";
> > }
> > }
> >
> >
> >
> > I am inserting an array of arrays..., I know it's not the best way to do
> > this but I was only given a few hours to get this up.
> >
> > The array is delimited by a double underscore and individual answers are
> > delimited by a double hyphen.  Or at lease that's what's supposed to
> happen.
> >
> >
> >
> > $insert_query = "INSERT INTO SurveyTable
> >
> > (sur_ques_id, sur_ans, sur_num)
> >
> > VALUES (1, '$questions', 1)";
> >
> > $result = MSSQL_QUERY($insert_query) or die("Can not execute query
> > $insert_query. ");
> >
> >
> >
> > The value in the db is either "Array" or part of the string but not the
> > whole string.  I know the error is creating most of the problem.
> >
> >
> >
> > I can't see what I'm doing wrong Why is that argument invalid?
> >
> >
> >
> > alex hogan
> >
> >
> >
> >
> >
> > **
> > The contents of this e-mail and any files transmitted with it are
> > confidential and intended solely for the use of the individual or
> > entity to whom it is addressed.  The views stated herein do not
> > necessarily represent the view of the company.  If you are not the
> > intended recipient of this e-mail you may not copy, forward,
> > disclose, or otherwise use it or any part of it in any form
> > whatsoever.  If you have received this e-mail in error please
> > e-mail the sender.
> > **
> >
> >
> >
> 
> --
> André Cerqueira


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 





RE: [PHP] Re: Loop Oops....

2004-03-03 Thread Alex Hogan

Well that fixed the error from coming up, but now the values in the db are
empty.  I don't even get "Array".



alex hogan


> -Original Message-
> From: Andre Cerqueira [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 03, 2004 9:34 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Loop Oops
> 
> probably, some of those $_SESSION['question#'] are unset, or arent
> arrays..
> 
> try:
> 
> foreach ($answers as $questions) {
>$question .= "__";
> 
>if (!is_array($questions))
>  continue;
>foreach ($questions as $subquestion)
>  $question .= $subquestion."--";
>}
> }
> 
> 
>  >$insert_query = "INSERT INTO SurveyTable
>  >(sur_ques_id, sur_ans, sur_num)
>  >VALUES (1, '$questions', 1)";
>  >
>  > $result = MSSQL_QUERY($insert_query) or die("Can not execute query
>  > $insert_query. ");
>  >
>  > The value in the db is either "Array" or part of the string but not
>  > the whole string.  I know the error is creating most of the problem.
> 
> you can only concatenate string with scalars (actually only strings, but
> php do some conversions...)
> if $questions is an array, you cant do that, and if its a string, you
> cant foreach it
> didnt you mean *VALUES (1, '$question', 1)"; ?
> 
> 
> maybe im missing something... but i hope this helps
> 
> 
> 
> Alex Hogan wrote:
> 
> > Hi All,
> >
> >
> >
> > I am having trouble with a nested loop and I can't seem to get it
> figured
> > out.
> >
> >
> >
> > I keep getting an error that states, Invalid argument on line 20.
> >
> >
> >
> > Here is the code;
> >
> >
> >
> > Sessions capture question answers that are multiple answers for each
> > question.
> >
> > $answers =
> >
> array($_SESSION['question1'],$_SESSION['question2'],$_SESSION['question3']
> ,$
> > _SESSION['question4'],
> >
> >
> >
> $_SESSION['question6'],$_SESSION['question7'],$_SESSION['question8'],$_SES
> SI
> > ON['question9'],
> >
> >
> $_SESSION['question10'],$_SESSION['question11']);
> >
> >
> >
> > I init the vars
> >
> > $question = "";
> >
> > $subquestion = "";
> >
> >
> >
> > Here's the loop I'm having trouble with.
> >
> > foreach ($answers as $questions) {
> >   $question .= "__";
> > foreach ($questions as $subquestion) { -- Here's the offending line
> --
> >   $question .= $subquestion."--";
> > }
> > }
> >
> >
> >
> > I am inserting an array of arrays..., I know it's not the best way to do
> > this but I was only given a few hours to get this up.
> >
> > The array is delimited by a double underscore and individual answers are
> > delimited by a double hyphen.  Or at lease that's what's supposed to
> happen.
> >
> >
> >
> > $insert_query = "INSERT INTO SurveyTable
> >
> > (sur_ques_id, sur_ans, sur_num)
> >
> > VALUES (1, '$questions', 1)";
> >
> > $result = MSSQL_QUERY($insert_query) or die("Can not execute query
> > $insert_query. ");
> >
> >
> >
> > The value in the db is either "Array" or part of the string but not the
> > whole string.  I know the error is creating most of the problem.
> >
> >
> >
> > I can't see what I'm doing wrong Why is that argument invalid?
> >
> >
> >
> > alex hogan
> >
> >
> >
> >
> >
> > **
> > The contents of this e-mail and any files transmitted with it are
> > confidential and intended solely for the use of the individual or
> > entity to whom it is addressed.  The views stated herein do not
> > necessarily represent the view of the company.  If you are not the
> > intended recipient of this e-mail you may not copy, forward,
> > disclose, or otherwise use it or any part of it in any form
> > whatsoever.  If you have received this e-mail in error please
> > e-mail the sender.
> > **
> >
> >
> >
> 
> --
> André Cerqueira


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 





[PHP] Loop Oops....

2004-03-03 Thread Alex Hogan
Hi All,

 

I am having trouble with a nested loop and I can't seem to get it figured
out.

 

I keep getting an error that states, Invalid argument on line 20.

 

Here is the code;

 

Sessions capture question answers that are multiple answers for each
question.

$answers =
array($_SESSION['question1'],$_SESSION['question2'],$_SESSION['question3'],$
_SESSION['question4'],

 
$_SESSION['question6'],$_SESSION['question7'],$_SESSION['question8'],$_SESSI
ON['question9'],

  $_SESSION['question10'],$_SESSION['question11']);

 

I init the vars

$question = "";

$subquestion = "";

 

Here's the loop I'm having trouble with.

foreach ($answers as $questions) {
  $question .= "__";
foreach ($questions as $subquestion) { -- Here's the offending line --
  $question .= $subquestion."--";
}
}



I am inserting an array of arrays..., I know it's not the best way to do
this but I was only given a few hours to get this up.

The array is delimited by a double underscore and individual answers are
delimited by a double hyphen.  Or at lease that's what's supposed to happen.

 

$insert_query = "INSERT INTO SurveyTable

(sur_ques_id, sur_ans, sur_num)

VALUES (1, '$questions', 1)";

$result = MSSQL_QUERY($insert_query) or die("Can not execute query
$insert_query. ");

 

The value in the db is either "Array" or part of the string but not the
whole string.  I know the error is creating most of the problem.

 

I can't see what I'm doing wrong Why is that argument invalid?

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] Survey code

2004-03-02 Thread Alex Hogan
I need to take some surveys that contain complicated question answer
schemes.

 

Does anyone know of a good survey script (preferable), or some good
tutorials they can point me to?

 

I would like to find something that is free;->

 

 

 

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Unexpected ";"

2004-02-19 Thread Alex Hogan
You also forgot to close your "if statement".

while ... and ... {
   if (($pic_num + 1) <= $thumb_num) {
  $tab = ((($pics * $page) - 1) + $pic_num); }



alex


> -Original Message-
> From: Paul Furman [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 19, 2004 11:33 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Unexpected ";"
> 
> I don't see what's wrong with this if statement:
> 
> while ... and ... {
>if (($pic_num + 1) <= $thumb_num {
>   $tab = ((($pics * $page) - 1) + $pic_num); }
> 
> Error unexpected ";" on the last line there.
> 
> 
> I added some extra () to make sure I had everything together & not two
> statements or something odd like that. The while loop above works with
> the if statement removed.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Unexpected ";"

2004-02-19 Thread Alex Hogan
Did you close your loop?


while ... and ... {
   if (($pic_num + 1) <= $thumb_num {
  $tab = ((($pics * $page) - 1) + $pic_num); 
   }
}


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Nested Loops

2004-02-19 Thread Alex Hogan
Thanks for the help guys...,

After some sleep and some food this is where it's gone;

$query = "select wn_pdate, wn_text, wn_id " . 
  "from whatsnew " .
  "order by wn_pdate";

$pdate = "";
while($row = mssql_fetch_array($result)){
if ($pdate != $row[0]) {
print "" . $row[0]";
$pdate = $row[0];
}

print "" . $row[1] . "";
}

Results;

Date 1
Item one
Item two
Item three

Date 2
Item four
Item five
Item six 

... etc

It produces the results that I was looking for and it's much less code.


alex hogan


> -Original Message-
> From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 19, 2004 4:50 AM
> To: 'Alex Hogan'; PHP General list
> Subject: RE: [PHP] Nested Loops
> 
> On 18 February 2004 22:13, Alex Hogan wrote:
> 
> > Sorry...,
> >
> >
> >
> > Line 17 is: print " > href=\"$id\">$row2[$rtxt]";
> 
> I haven't a clue what this is relating to (bit *too* much snippage
> there!), but I think that statement is going to need some curly braces to
> have a chance of working as intended:
> 
>print "{$row2[$rtxt]}";
> 
> 
> Cheers!
> 
> Mike
> 
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Nested Loops

2004-02-18 Thread Alex Hogan
Using print_r($var) shows that the vars are returning the right values, and
where they're supposed to.  Right in between the error messages.  Doh.



alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




  1   2   >