Re: [PHP] function problem

2005-01-03 Thread Matthew Weier O'Phinney
* Richard Lynch <[EMAIL PROTECTED]>: > > > '$shippingCountry1')"))) > > { > >echo "the insertiont cannot be done"; > > echo mysql_error(); > > http://php.net/mysql_error > > >exit(); > > } > > header("Location:http://$HTTP_HOST/$DOCROOT/allright.html";); > > DON'T DO THAT!!! > > Just

Re: [PHP] function problem

2005-01-03 Thread Richard Lynch
> '$shippingCountry1')"))) > { >echo "the insertiont cannot be done"; echo mysql_error(); http://php.net/mysql_error >exit(); > } > header("Location:http://$HTTP_HOST/$DOCROOT/allright.html";); DON'T DO THAT!!! Just do: include 'allright.html'; The Location header is for a docu

Re: [PHP] function problem

2005-01-03 Thread Viktor Popov
Hi! Thank you for the reply! I have change the function: function doReg($fname1="",$family1="",$company1="", $MOL1="", $dannum1="", $bulstat1="", $phone1="", $email1="", $username1="", $password1="", $payment1="", $maillist1="", $Addr1="", $City1="", $zipcode1="", $Country1="", $shippingName1=""

Re: [PHP] function problem

2005-01-02 Thread Ligaya Turmelle
Are you getting an error? If so what does it say. Also in your code you have nothing to tell you if something is going wrong. Use echo statements - say something if the connection or the query doesn't go through. Also noticed that when you made the connection to the DB you didn't assign it t

[PHP] function problem

2005-01-02 Thread Viktor Popov
Hi, I'm trying to do the following but I don't have any success. Could you help me here... I have this code in mu page: $value) { $$key = $value; } $valid = $fn = checkLength($fname, 2, 50); $ln = checkLength($family, 2, 50); $valid = $valid && $ln; $cm = checkLength($comp

[PHP] function problem

2004-09-04 Thread Matthias Bauw
I'm having a problem with a php application; I have two files: one is ccadduser wich adds users to a controlcenter that I am currently designing for a website. In that ccaduserfile I call for a function checkpermission(); this function is defined in another file called ccfunctions When a user do

Re: [PHP] Function Problem

2004-09-01 Thread Jim Grill
> I'm having a problem with a php application; > > I have two files: one is ccadduser wich adds users to a controlcenter > that I am currently designing for a website. > > In that ccaduserfile I call for a function checkpermission(); this > function is defined in another file called ccfunctions > >

[PHP] Function Problem

2004-09-01 Thread Matthias Bauw
I'm having a problem with a php application; I have two files: one is ccadduser wich adds users to a controlcenter that I am currently designing for a website. In that ccaduserfile I call for a function checkpermission(); this function is defined in another file called ccfunctions When a user do

RE: [PHP] Function Problem (Long-ish)

2004-01-13 Thread Dave Carrera
-Original Message- From: Vincent Jansen [mailto:[EMAIL PROTECTED] Sent: 13 January 2004 13:05 To: 'Dave Carrera'; 'Richard Davey' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Function Problem (Long-ish) I doubt that... MySQL says: Mixing of GROUP columns (MIN(),MAX(),COUNT()...) w

Re[2]: [PHP] Function Problem (Long-ish)

2004-01-13 Thread Richard Davey
Hello Dave, Tuesday, January 13, 2004, 12:57:35 PM, you wrote: DC> If I use this sql in my func: DC> $sql = mysql_query("select count(fieldtocount) as cnt, sum(fieldforsum) as DC> total from $tab3 where fieldtocompare =\"$varcomparedwith\""); DC> Then all is fine and works as expected. Is this

RE: [PHP] Function Problem (Long-ish)

2004-01-13 Thread Vincent Jansen
y' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Function Problem (Long-ish) Thanks for the reply Richard. If I use this sql in my func: $sql = mysql_query("select count(fieldtocount) as cnt, sum(fieldforsum) as total from $tab3 where fieldtocompare =\"$varcomparedwith\"");

RE: [PHP] Function Problem (Long-ish)

2004-01-13 Thread Dave Carrera
I am puzzled why and if you or the list can help I would appreciate it. Thank you Dave C -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: 13 January 2004 12:48 To: Dave Carrera Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Function Problem (Long-ish) Hello Dave, Tue

Re: [PHP] Function Problem (Long-ish)

2004-01-13 Thread Jason Wong
On Tuesday 13 January 2004 20:34, Dave Carrera wrote: [snip] > My Question is Why ? > > Any help is a appreciated and I thank you fully in advance. You're not checking for errors. Incorporate error checking code and make use of mysql_error(). -- Jason Wong -> Gremlins Associates -> www.gremli

Re: [PHP] Function Problem (Long-ish)

2004-01-13 Thread CPT John W. Holmes
From: "Dave Carrera" <[EMAIL PROTECTED]> > I get a Warning: > mysql_fetch_array(): supplied argument is not a valid MySQL result resource Whenever you get this warning it's because your query failed for some reason and you're trying to use a result that's not valid. Use mysql_error() to see wha

Re: [PHP] Function Problem (Long-ish)

2004-01-13 Thread Richard Davey
Hello Dave, Tuesday, January 13, 2004, 12:34:33 PM, you wrote: DC> sql = mysql_query("select *, count(id) as cnt from table where DC> somefield=\"somevar\""){ It's nothing to do with your function, simply that your SQL is invalid. -- Best regards, Richardmailto:[E

[PHP] Function Problem (Long-ish)

2004-01-13 Thread Dave Carrera
Hi List, I have a self-made function that uses a MySql statement something like this: Function MyFunc(){ sql = mysql_query("select * from table where somefield=\"somevar\""){ while(blah blah){ $var ="blah blah"; } } return $blah; } This works ok but if I add a bit to the sql then I ge

RE: [PHP] function problem?

2003-12-30 Thread Jay Blanchard
[snip] Not sure why the last section won't work... ...so much code it made my head hurt [/snip] Not sure either. Did you have a question? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] function problem?

2003-12-30 Thread Jas
Not sure why the last section won't work... /* Function to search for hosts */ function search_dhcp() { if ((empty($_POST['search'])) && (empty($_POST['hosts01'])) && (empty($_POST['hn'])) && (empty($_POST['ma'])) && (empty($_POST['i'])) && (empty($_POST['v']))) { unset($_SESSION['search']);

Re: [PHP] function problem (simple redirect)

2003-10-27 Thread Chris Shiflett
--- Frank Tudor <[EMAIL PROTECTED]> wrote: > function $payment{ You probably mean payment, not $payment. > header ("location:test_page.html"); The Location header has an uppercase L, a space after the colon, and an absolute URL after the space. Your example violates all three. Hope that helps.

RE: [PHP] function problem (simple redirect)

2003-10-27 Thread Gregory Kornblum
Make that: function payment{ global $payment; -Gregory -Original Message- From: Gregory Kornblum [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 1:30 PM To: 'Frank Tudor'; 1PHP Subject: RE: [PHP] function problem (simple redirect) >function $payment{ C

RE: [PHP] function problem (simple redirect)

2003-10-27 Thread Gregory Kornblum
>function $payment{ Change that to: function payment{ $global $payment; Regards, -Gregory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] function problem (simple redirect)

2003-10-27 Thread Frank Tudor
I'm trying to make this function work, but I'm not good at functions. I have created a variable for testing payment equal to 1 or 0 to see what would happen based on whatever the condition is in my database (the sql stuff is not here because i have to figure this thing out first). I get a t_strin

Re: [PHP] function problem

2003-02-14 Thread Nicholas Wieland
On 2003.02.15 00:11 Peter Gumbrell wrote: [...] $option_block .= " [...] Are you sure it's a scope problem ? You haven't instantiated any $option_block variable when the loop starts, so you're concatenating a string to a bunch of uninitialized memory :) I can't run your script at the moment, so

RE: [PHP] function problem

2003-02-14 Thread Peter Gumbrell
Friday, February 14, 2003 6:41 PM To: Php-General Subject: Re: [PHP] function problem Exactly where does $option_block get put into $string? -Kevin - Original Message - From: "Peter Gumbrell" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Fri

Re: [PHP] function problem

2003-02-14 Thread Kevin Stone
Exactly where does $option_block get put into $string? -Kevin - Original Message - From: "Peter Gumbrell" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Friday, February 14, 2003 4:11 PM Subject: [PHP] function problem > I have a func

[PHP] function problem

2003-02-14 Thread Peter Gumbrell
I have a function below which populates a select list, based on the query string and the field name. It then prints a string: function populate_selects($query_name, $db_field, $link, $string) { $result = mysql_query($query_name, $link) or die ("Could not execute query."); while ($columns = mysql_f

Re: [PHP] Function Problem

2002-11-09 Thread conbud
Hey, Of course they do, they work if I put the echo in the function its self, but I dont need the echo in the function. - Lee "Marco Tabini" <[EMAIL PROTECTED]> wrote in message news:1036911387.23753.1054.camel@;localhost.localdomain... > Either add > > global $db; > > as the first line of the fu

Re: [PHP] Function Problem

2002-11-09 Thread Marco Tabini
Either add global $db; as the first line of the function or change your function call to: $db = db_conn("$host","$user","$pass","$dab"); I assume that $host, $user, $pass and $dab actually contain some correct values. Marco -- php|architect - The magazine for PHP Professionals T

[PHP] Function Problem

2002-11-09 Thread conbud
Hey Im trying to create a fucntion in an include file function db_conn($host,$user,$pass,$dab) { $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db); } In the page ide use: require('func.inc.php'); db_conn("$host","$user","$pass","$dab"); $result = mysql_query("select

Re: [PHP] function problem ...

2001-02-07 Thread Frederico Augusto Costa
Try require_once($your_file) or verify in $your_file use the function function_exists() []'s Frederico Augusto Costa [EMAIL PROTECTED] On Wed, 7 Feb 2001, Miguel Loureiro wrote: > Hello > I have a script that use other script file(php) twice, I c

[PHP] function problem ...

2001-02-07 Thread Miguel Loureiro
Hello I have a script that use other script file(php) twice, I call a function with certain parameters and call it again with other parameters and when runnig the script, the first function works well, but on second time I got a error message: "Fatal error: Cannot redeclare getndays() in Unknow