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=,
$shippingFamily1=,
'$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 document that
* 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 do:
include
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:
?php
include script/functions.php;
require 'script/common.inc';
$valid = TRUE;
if (isset ($_POST['submit'])) {
foreach($_POST as $key=$value) {
$$key = $value;
}
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
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
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
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
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 get a
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:[EMAIL
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 what the
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 -
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,
Tuesday, January 13, 2004, 12:34:33 PM, you wrote:
DC
: [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\);
Then all is fine and works
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 MySQL?
-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()...) with no GROUP columns
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']);
[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
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
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
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{
Change
--- 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.
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 =
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 function below which populates a select list
$option_block;
/SELECT
input type=hidden name=vendor_select value=v
INPUT TYPE=Submit NAME=Submit Value=Submit
/FORM
EOVS;
-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 14, 2003 6:41 PM
To: Php-General
Subject: Re: [PHP] function problem
On 2003.02.15 00:11 Peter Gumbrell wrote:
[...]
$option_block .= OPTION name='vendor1'
[...]
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
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 * FROM
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
The
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 function or
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
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
31 matches
Mail list logo