What is the output?
On Sun, Sep 29, 2013 at 1:34 AM, Ethan Rosenberg
erosenb...@hygeiabiomedical.com wrote:
On 09/28/2013 10:53 PM, Aziz Saleh wrote:
Ethan, can you do a var_dump instead of print_r. It might be that
next_step
has spaces in it causing the switch to not match.
Aziz
Hello,
I suggest you put default in that switch statement and var_dump the
$_POST.That should be enough for a programmer to pin point what goes wrong.
P:S
**You might want to consider versioning your codes to go back into its
history to see what has changed.
Muhsin
On 09/29/2013 04:33 AM,
Dear List -
I have a working program. I made one change in a switch statement, and
it does not work. I'm probably missing something fundamental.
Here are some code SNIPPETS... [please note that all my debug
statements are at the left margin]
Setup...
?php
session_start();
Ethan, can you do a var_dump instead of print_r. It might be that next_step
has spaces in it causing the switch to not match.
Aziz
On Sat, Sep 28, 2013 at 10:33 PM, Ethan Rosenberg
erosenb...@hygeiabiomedical.com wrote:
Dear List -
I have a working program. I made one change in a switch
On 09/28/2013 10:53 PM, Aziz Saleh wrote:
Ethan, can you do a var_dump instead of print_r. It might be that next_step
has spaces in it causing the switch to not match.
Aziz
snip
Aziz -
Used var_dump no further information
Ethan
--
PHP General Mailing List (http://www.php.net/)
To
I'm looking for an 'unless' statement, but as far as I can tell, PHP
doesn't have one. Hopefully someone can help me rewrite my statement.
In English, I want to say: always do something UNLESS these 3
conditions are met.
The best I've been able to come up with in PHP
Since you already have the return statement with the if statement the else
isn't required. If those three statements are true you would exit the call
any ways
On Mar 11, 2013 4:33 PM, Angela Barone ang...@italian-getaways.com
wrote:
I'm looking for an 'unless' statement, but as far as I
On Mon, 2013-03-11 at 16:38 -0500, Jonathan Sundquist wrote:
Since you already have the return statement with the if statement the else
isn't required. If those three statements are true you would exit the call
any ways
On Mar 11, 2013 4:33 PM, Angela Barone ang...@italian-getaways.com
On Mar 11, 2013, at 2:38 PM, Jonathan Sundquist wrote:
Since you already have the return statement with the if statement the else
isn't required. If those three statements are true you would exit the call
any ways
I don't follow. The else contains the meat of the statement.
What you have
if ( ($current_page == $saved_page) and ($current_ip == $saved_ip) and
($current_dt ($saved_dt + 3600)) ) {
return;
} else {
$query = UPDATE `table` SET `hits` = '$count', `agent` =
'$agent', `ts` = '$date_time' WHERE `page` = '$page';
$result =
On Mar 11, 2013, at 3:47 PM, Ashley Sheridan wrote:
if ( !( ($current_page == $saved_page) and ($current_ip == $saved_ip) and
($current_dt ($saved_dt + 3600)) ) )
Hello Ash,
This makes sense to me, but I can't get it to work, so I'm either not
understanding it or I'm asking the
Angela,
the variable $current_page does not exist. so $curent_page does not equal
$saved_page. Also the ! in front of the entire statement means that all of
this is false. Since one items is true and not true = false Don't save
is echoed out.
If you are looking to save the results based on the
On Mar 11, 2013, at 4:10 PM, Jonathan Sundquist wrote:
the variable $current_page does not exist.
That was my problem. :( I've been staring at this for too long. Too
bad there's not a 'use strict' pragma.
I would also suggest keeping with your original statement to return early and
On 3/11/13 6:25 PM, Angela Barone wrote:
On Mar 11, 2013, at 4:10 PM, Jonathan Sundquist wrote:
the variable $current_page does not exist.
That was my problem. :( I've been staring at this for too long. Too
bad there's not a 'use strict' pragma.
There is. Always set your
I'm at my wits end trying to make this mysql statement insert work in
PHP. I'm not getting any errors from PHP or mysql but the insert fails
(nothing is inserted) error reporting is on and is reporting other
errors. When I echo out the query and manually paste it into PHP
myAdmin the query inserts
Try putting tick marks (`) around the field and table names. So your
SQL query would then look like:
INSERT INTO `history` (`v_id`, `hour`, `visits`, `date`) VALUES (45, 0,
59, '2010 01 27');
This is a good practice to get into. The problem is that MySQL allows
you to create tables and
james stojan wrote on 11/02/2010 22:21:
$query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
(.$v_id.,.$hour.,.$visits.,'$date1'.);;
The ,'$date1'. is not correct syntax, change it to ,'.$date.'
--
Kind regards
Kim Emax - masterminds.dk
--
PHP General Mailing List
Also, in PHP you should NOT put the last semi-colon at the end of your SQL
statement. http://www.php.net/manual/en/function.mysql-query.php
On Feb 11, 2010, at 1:26 PM, Joseph Thayne wrote:
Try putting tick marks (`) around the field and table names. So your SQL
query would then look like:
Thank you.
You were right on the money, hour was the problem and the tick marks
solved it. I spent 3 hours trying to figure out why I never got an error but
there was no insert and php myadmin does add the tick marks automatically.
Probably a good habit to always use the tick marks.
Learn
Actually, the syntax is just fine. I personally would prefer it the way
you mention, but there actually is nothing wrong with the syntax.
The ,'$date1'. is not correct syntax, change it to ,'.$date.'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
On Fri, Feb 12, 2010 at 8:27 AM, Joseph Thayne webad...@thaynefam.org wrote:
Actually, the syntax is just fine. I personally would prefer it the way you
mention, but there actually is nothing wrong with the syntax.
The ,'$date1'. is not correct syntax, change it to ,'.$date.'
My personal
That is a good idea to use the curly braces. I consistently forget
about them, and fell like an idiot every time I am reminded of them.
As for the backticks, they are required because of MySQL, not because of
phpMyAdmin. The issue was not that phpMyAdmin uses backticks, it is
that MySQL
Op 2/11/10 10:51 PM, James McLean schreef:
On Fri, Feb 12, 2010 at 8:27 AM, Joseph Thayne webad...@thaynefam.org wrote:
Actually, the syntax is just fine. I personally would prefer it the way you
mention, but there actually is nothing wrong with the syntax.
The ,'$date1'. is not correct
On Fri, Feb 12, 2010 at 9:31 AM, Jochem Maas joc...@iamjochem.com wrote:
Op 2/11/10 10:51 PM, James McLean schreef:
My personal preference these days is to use Curly braces around
variables in strings such as this, I always find excessive string
concatenation such as is often used when
On Fri, Feb 12, 2010 at 9:31 AM, Joseph Thayne webad...@thaynefam.org wrote:
As for the backticks, they are required because of MySQL, not because of
phpMyAdmin. The issue was not that phpMyAdmin uses backticks, it is that
MySQL pretty much requires them when naming a field the same as an
Yeah, I am a lot more descriptive now. I ran into it quite a bit when I
was first starting out.
James McLean wrote:
On Fri, Feb 12, 2010 at 9:31 AM, Joseph Thayne webad...@thaynefam.org wrote:
As for the backticks, they are required because of MySQL, not because of
phpMyAdmin. The issue
On Fri, Feb 12, 2010 at 09:44:47AM +1030, James McLean wrote:
On Fri, Feb 12, 2010 at 9:31 AM, Joseph Thayne webad...@thaynefam.org wrote:
As for the backticks, they are required because of MySQL, not because of
phpMyAdmin. The issue was not that phpMyAdmin uses backticks, it is that
for you and you can
then focus on other things such as data integrity and general processing
speed?
Joseph
-Original Message-
From: Paul M Foster [mailto:pa...@quillandmouse.com]
Sent: Thursday, February 11, 2010 9:15 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Mysql statement works
On Thu, Feb 11, 2010 at 09:49:02PM -0600, Joseph Thayne wrote:
I was going to write an example as to what should happen instead of what
actually does when id dawned on me why MySQL works the way it does. One of
the biggest complaints people have with MySQL is in speed.
The much-vaunted
Hi,
I have a code snippet here as in the following:
//Switch statements between the four options
switch($string) {
case :
$string= NOT book.author='All';
break;
default:
$string= $string . AND NOT book.author='All';
break;
}
This code does work, but I am wondering if it is possible in
Hi,
I have a code snippet here as in the following:
//Switch statements between the four options
switch($string) {
case :
$string= NOT book.author='All';
break;
default:
$string= $string . AND NOT book.author='All';
break;
}
This code does work, but I am wondering if it is possible in
-Original Message-
From: Alice Wei [mailto:aj...@alumni.iu.edu]
Sent: Thursday, January 29, 2009 3:02 PM
To: php-general@lists.php.net
Subject: [PHP] Switch statement Question
Hi,
I have a code snippet here as in the following:
//Switch statements between the four options
Boyd, Todd M. schreef:
-Original Message-
From: Alice Wei [mailto:aj...@alumni.iu.edu]
Sent: Thursday, January 29, 2009 3:02 PM
To: php-general@lists.php.net
Subject: [PHP] Switch statement Question
Hi,
I have a code snippet here as in the following:
//Switch statements
thanks for answering my question.
I have checked PHP PDO doc.
PDO:: query() can send a query to server.
my question is, does PDO:: query() generates prepared statement
automatically?
or I have to explicitly call PDO:: prepare() to use prepared statement?
for example:
PDO:: query(select name
ctx2002 wrote:
thanks for answering my question.
I have checked PHP PDO doc.
PDO:: query() can send a query to server.
my question is, does PDO:: query() generates prepared statement
automatically?
or I have to explicitly call PDO:: prepare() to use prepared statement?
You have to use
Hi all:
We are use PHP PDO's Prepared statement to send SQL query to Mysql server.
According to PHP PDO doc, Prepared statement are fast for executing multiple
SQL queries with same parameters. by using prepared statement you avoid
repeating the analyze/compile/optimize cycle
Our application
ctx2002 wrote:
Hi all:
We are use PHP PDO's Prepared statement to send SQL query to Mysql server.
According to PHP PDO doc, Prepared statement are fast for executing multiple
SQL queries with same parameters. by using prepared statement you avoid
repeating the analyze/compile/optimize cycle
will compile that prepared statement and save it somewhere in
Server. now client two connect to our site and send same prepared statement
except has a different ID to our DB, does PHP pdo / mysql server will re use
that compiled prepared statement or the php PDO/mysql server will re
compile prepared
ctx2002 wrote:
I mean for each different requests/connection how can i use same prepared
statements object that was
generated by PDO lib/mysql Server.
You can't.
Resources/connections are done per request and can't be shared - it's
done that way by design.
--
Postgresql php tutorials
so only benefit for use prepared statement in Web environment is to prevent
SQL
injection?
regards
chris smith-9 wrote:
ctx2002 wrote:
I mean for each different requests/connection how can i use same prepared
statements object that was
generated by PDO lib/mysql Server.
You
On Wednesday 25 June 2008 8:24:06 pm ctx2002 wrote:
so only benefit for use prepared statement in Web environment is to prevent
SQL
injection?
regards
It's somewhat more complicated than that. (The following is based on my own
experiences with PDO and a conversation with PDO's original
I'd suggest a tutorial or something on BOOLEAN or LOGICAL OPERATORS.
For example:
true and false = false
true or false = true
not true and not false = false
not true or not false = true
and so on...
The IF statement will simply take the result of a logical operation,
and the result will either
On Thu, 2007-10-18 at 19:57 -0500, ron.php wrote:
I just tried to send this to the list. I am not trying make it post again, I
don't think I had the e-mail address correct the first time.
I am trying to stop $component_reference from doing the echo below when the
value is 5 or 19. I
I just tried to send this to the list. I am not trying make it post again, I
don't think I had the e-mail address correct the first time.
I am trying to stop $component_reference from doing the echo below when the
value is 5 or 19. I don't have the syntax right though. What did I miss?
Ron
just change OR by AND.
2007/10/19, ron.php [EMAIL PROTECTED]:
I just tried to send this to the list. I am not trying make it post again, I
don't think I had the e-mail address correct the first time.
I am trying to stop $component_reference from doing the echo below when the
value is 5 or
Jason Pruim wrote:
The code I had worked out, originally was something along the lines of:
if($row[5] ==Level1) (
echo TRTD bgcolor=.$Level1.$row[0] /td;
echo td bgcolor=.$Level1.$row[1] /td;
echo td bgcolor=.$Level1.A href='$row[2]'Instructions/A/td;
echo TD
On Jun 21, 2007, at 1:42 PM, Roberto Mansfield wrote:
Jason Pruim wrote:
The code I had worked out, originally was something along the
lines of:
if($row[5] ==Level1) (
echo TRTD bgcolor=.$Level1.$row[0] /td;
echo td bgcolor=.$Level1.$row[1] /td;
echo td bgcolor=.$Level1.A
Jason Pruim wrote:
It's not quite making sense to me though... My understanding of IF
statements is if the condition is met it ignores all the other if's. Is
that not correct? At this point it's just me trying to figure things out
for my knowledge :)
No, that's not how it works. If the
On Jun 21, 2007, at 1:58 PM, Roberto Mansfield wrote:
Jason Pruim wrote:
It's not quite making sense to me though... My understanding of IF
statements is if the condition is met it ignores all the other
if's. Is
that not correct? At this point it's just me trying to figure
things out
Jason Pruim wrote:
On Jun 21, 2007, at 1:58 PM, Roberto Mansfield wrote:
Jason Pruim wrote:
It's not quite making sense to me though... My understanding of IF
statements is if the condition is met it ignores all the other if's. Is
that not correct? At this point it's just me trying to
On Jun 19, 2007, at 4:20 PM, Jim Lucas wrote:
Jason Pruim wrote:
Okay, so I have a question... Probably pretty easy, but why would
my if statement show more records then what are in the database?
if($row[5] =='Level4'){ // White Highlight
echo TRTD bgcolor=.$Level4.$row[0] /td;
Jason Pruim wrote:
On Jun 19, 2007, at 4:20 PM, Jim Lucas wrote:
Jason Pruim wrote:
Okay, so I have a question... Probably pretty easy, but why would my
if statement show more records then what are in the database?
if($row[5] =='Level4'){ // White Highlight
echo TRTD
On 6/20/07, Jim Lucas [EMAIL PROTECTED] wrote:
I would look at your result set and see if you had multiple lines
returned. One person mentioned that you might be using a JOIN in you
SQL call. This could lead to multiple lines.
Start investigating your SQL statement I would suggest.
On Jun 20, 2007, at 10:56 AM, Daniel Brown wrote:
On 6/20/07, Jim Lucas [EMAIL PROTECTED] wrote:
I would look at your result set and see if you had multiple lines
returned. One person mentioned that you might be using a JOIN in you
SQL call. This could lead to multiple lines.
Start
On 6/20/07, Jason Pruim [EMAIL PROTECTED] wrote:
Hey Jim,
You're right it is the system you helped me get started with, Just
wanted to add a little color coding for the different levels :)
Here is the sql query:
$sql = SELECT * FROM tasks WHERE completed='0' order by id;
$sql .= AND
Okay, so I have a question... Probably pretty easy, but why would my
if statement show more records then what are in the database?
if($row[5] =='Level4'){ // White Highlight
echo TRTD bgcolor=.$Level4.$row[0] /td;
echo td bgcolor=.$Level4.$row[1]
Jason Pruim wrote:
Okay, so I have a question... Probably pretty easy, but why would my if
statement show more records then what are in the database?
if($row[5] =='Level4'){ // White Highlight
echo TRTD bgcolor=.$Level4.$row[0] /td;
echo td bgcolor=.$Level4.$row[1]
David Duong wrote:
Hi everyone,
Let me know if there is a better place to post this.
I am playing with the idea of creating a true (KISS) abstraction layer
that makes full use of PHP5's OOP support. So logically it would make
sense to make use PDO wherever possible, however, one of PDO's
Hi everyone,
Let me know if there is a better place to post this.
I am playing with the idea of creating a true (KISS) abstraction layer
that makes full use of PHP5's OOP support. So logically it would make
sense to make use PDO wherever possible, however, one of PDO's design
decisions was
On 9/8/06, Robert Cummings [EMAIL PROTECTED] wrote:
On Fri, 2006-09-08 at 15:30 -0600, Jeremy Privett wrote:
Well, it could be this, too:
switch( $_REQUEST['id'] ) {
case white:
echo Right color.;
break;
case black:
echo Right color.;
.
Satyam
- Original Message -
From: Kevin Murphy [EMAIL PROTECTED]
To: php php-general@lists.php.net
Cc: JD [EMAIL PROTECTED]
Sent: Friday, September 08, 2006 11:25 PM
Subject: Re: [PHP] if statement with or comparison (newbie)
Shouldn't that be this instead:
if (($_REQUEST['id
Robert Cummings wrote:
On Fri, 2006-09-08 at 18:38 -0400, tedd wrote:
At 5:03 PM -0400 9/8/06, JD wrote:
In all of the answers given thus far, no one mentioned that the use
of $_REQUEST has a security issue with regard to where the $_REQUEST
originated.
$_REQUEST is an array
Mark Charette wrote:
However, looking at it from a 'knowing early the data is tainted'
perspective, not from a 'validating and cleaning perspective', if you
have coded that (for instance) a variable is set via COOKIE, then only
looking for that variable set via COOKIE will eliminate its being
On Sat, 2006-09-09 at 10:21 -0400, Mark Charette wrote:
Robert Cummings wrote:
On Fri, 2006-09-08 at 18:38 -0400, tedd wrote:
At 5:03 PM -0400 9/8/06, JD wrote:
In all of the answers given thus far, no one mentioned that the use
of $_REQUEST has a security issue with regard
Stut wrote:
Mark Charette wrote:
However, looking at it from a 'knowing early the data is tainted'
perspective, not from a 'validating and cleaning perspective', if you
have coded that (for instance) a variable is set via COOKIE, then
only looking for that variable set via COOKIE will
On Sat, 2006-09-09 at 11:30 -0400, Mark Charette wrote:
Stut wrote:
Mark Charette wrote:
However, looking at it from a 'knowing early the data is tainted'
perspective, not from a 'validating and cleaning perspective', if you
have coded that (for instance) a variable is set via COOKIE,
Robert Cummings wrote:
On Sat, 2006-09-09 at 11:30 -0400, Mark Charette wrote:
Stut wrote:
Mark Charette wrote:
However, looking at it from a 'knowing early the data is tainted'
perspective, not from a 'validating and cleaning perspective', if you
have coded that (for
Mark Charette wrote:
And I'll wager a brew no one here has ever done a formal, mathematically
rigorous proof of a validation routine except as a class project. As a
senior member of the software QC department in a major industrial
company, I generally find more errors and omissions in
On Sat, 2006-09-09 at 12:12 -0400, Mark Charette wrote:
As a senior member of the software QC department in a major industrial
company, I generally find more errors and omissions in validation
routines during code reviews and ethical hacks than anywhere else.
On Sat, 2006-09-09 at 17:27 +0100, Stut wrote:
Mark Charette wrote:
And I'll wager a brew no one here has ever done a formal, mathematically
rigorous proof of a validation routine except as a class project. As a
senior member of the software QC department in a major industrial
company,
At 12:29 PM -0400 9/9/06, Robert Cummings wrote:
On Sat, 2006-09-09 at 12:12 -0400, Mark Charette wrote:
As a senior member of the software QC department in a major industrial
company, I generally find more errors and omissions in validation
routines during code reviews and ethical hacks
I'm trying to set up a simple conditional, something like this:
If my_variable is NOT equal to (black or white)
echo wrong color
else
echo right color
Here is what I have tried:
if ($_REQUEST['id'] != (black or white)) {
echo wrong color;
} else (
echo right
Message -
From: JD [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Friday, September 08, 2006 5:03 PM
Subject: [PHP] if statement with or comparison (newbie)
I'm trying to set up a simple conditional, something like this:
If my_variable is NOT equal to (black or white)
echo wrong
;
} else (
echo right color;
}
- Original Message -
From: JD [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Friday, September 08, 2006 5:03 PM
Subject: [PHP] if statement with or comparison (newbie)
I'm trying to set up a simple conditional, something like
I think the OR should be an AND ...
If $_REQUEST['id'] = black then the second test will be true and it
will output wrong color. If the color is white then the same thing
will happen 'cause it meets the first criteria.
-- Mitch
Kevin Murphy wrote:
Shouldn't that be this instead:
: Re: [PHP] if statement with or comparison (newbie)
Shouldn't that be this instead:
if (($_REQUEST['id'] != black) OR ($_REQUEST['id'] !=
white)) {
echo wrong color;
} else {
echo right color;
}
--
Kevin Murphy
Webmaster: Information and Marketing
- Original Message -
From: JD [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Friday, September 08, 2006 11:03 PM
Subject: [PHP] if statement with or comparison (newbie)
I'm trying to set up a simple conditional, something like this:
If my_variable is NOT equal to (black
At 05:30 PM 9/8/2006, you wrote:
- Original Message - From: JD [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Friday, September 08, 2006 11:03 PM
Subject: [PHP] if statement with or comparison (newbie)
I'm trying to set up a simple conditional, something like
On Fri, 2006-09-08 at 15:30 -0600, Jeremy Privett wrote:
Well, it could be this, too:
switch( $_REQUEST['id'] ) {
case white:
echo Right color.;
break;
case black:
echo Right color.;
break;
default:
echo Wrong
At 5:03 PM -0400 9/8/06, JD wrote:
I'm trying to set up a simple conditional, something like this:
Here is what I have tried:
if ($_REQUEST['id'] != (black or white)) {
In all of the answers given thus far, no one mentioned that the use
of $_REQUEST has a security issue with regard to
On Fri, 2006-09-08 at 18:38 -0400, tedd wrote:
At 5:03 PM -0400 9/8/06, JD wrote:
I'm trying to set up a simple conditional, something like this:
Here is what I have tried:
if ($_REQUEST['id'] != (black or white)) {
In all of the answers given thus far, no one mentioned that the
On Mon, June 26, 2006 1:23 pm, Robert Cummings wrote:
I can't think of any language that processes the contents of a
conditional block when the test condition fails.
I believe that PHP with Runkit would let you set that up to happen, if
it was something you actually wanted... :-)
And Common
Hi list.
Basically, I'm still learning new things about php and I was wondering if
things inside an if statement get 'looked at' by a script if the condition
is false.
For example, would this mysql query get executed if $number = 0 ?
If ($number == 1) {
mysql_query($blah)
}
I know that's not
On Mon, 26 Jun 2006 19:10:59 +0100, Alex Major [EMAIL PROTECTED] wrote:
Hi list.
Basically, I'm still learning new things about php and I was wondering if
things inside an if statement get 'looked at' by a script if the condition
is false.
For example, would this mysql query get executed if
On Mon, 2006-06-26 at 14:10, Alex Major wrote:
Hi list.
Basically, I'm still learning new things about php and I was wondering if
things inside an if statement get 'looked at' by a script if the condition
is false.
For example, would this mysql query get executed if $number = 0 ?
If
On Monday 26 June 2006 13:10, Alex Major wrote:
Hi list.
Basically, I'm still learning new things about php and I was wondering if
things inside an if statement get 'looked at' by a script if the condition
is false.
For example, would this mysql query get executed if $number = 0 ?
If
On Wed, March 22, 2006 10:29 pm, Mark wrote:
How can i make this email from a database a hyperlink so it doesnt
show the
email address--i have tried many things but i keep getting errors. At
the
moment it just shows the email (no link)
thanks
?php
//get comp_id
$query =
How can i make this email from a database a hyperlink so it doesnt show the
email address--i have tried many things but i keep getting errors. At the
moment it just shows the email (no link)
thanks
?php
//get comp_id
$query = mysql_query(SELECT * FROM comps WHERE name = '$comp_name');
Mark wrote:
How can i make this email from a database a hyperlink so it doesnt show the
email address--i have tried many things but i keep getting errors. At the
moment it just shows the email (no link)
thanks
?php
//get comp_id
$query = mysql_query(SELECT * FROM comps WHERE name =
On 12/21/05, Anasta [EMAIL PROTECTED] wrote:
Can someone tell me why this select is wrong please---ive tried everything.
the $cat is the tablename .
You've tried *everything* ?
Why do you think it's wrong? Did you get an error message of some kind?
What do you see if you echo $query? Are the
Can someone tell me why this select is wrong please---ive
tried everything.
the $cat is the tablename .
$query= SELECT title FROM $cat WHERE id='$id';
Apparently, either $cat or $id is not the value you think it is. First, I
would try changing
$result=mysql_query($query);
to
[snip]
$query= SELECT title FROM $cat WHERE id='$id';
[/snip]
echo $query; // does it look right to you?
Alway throw an error when in question
if(!($result = mysql_query($query, $connection))){
echo mysql_error() . br\n;
exit();
}
My bet is that you need to concatenate
$query = SELECT
side-question
Jay how come you though concating would give
a different result to interpolation?
/side-question
Jay Blanchard wrote:
[snip]
$query= SELECT title FROM $cat WHERE id='$id';
[/snip]
echo $query; // does it look right to you?
Alway throw an error when in question
if(!($result =
[snip]
side-question
Jay how come you though concating would give
a different result to interpolation?
/side-question
[/snip]
It is not really a different result, it is just something that I am in the
habit of doing. The concat or not to concat question has fueled many a
holy war. I concat,
Jay Blanchard wrote:
[snip]
side-question
Jay how come you though concating would give
a different result to interpolation?
/side-question
[/snip]
It is not really a different result, it is just something that I am in the
habit of doing. The concat or not to concat question has fueled many a
Can someone tell me why this select is wrong please---ive tried everything.
the $cat is the tablename .
$query= SELECT title FROM $cat WHERE id='$id';
full script below
?
$id=$_POST['id'];
$cat=$_POST['cat'];
$db=flash_software;
$link = mysql_connect('localhost');
if (! $link)
die(Couldn't
On 03 November 2005 15:26, Brent Baisley wrote:
You only need one if. The parenthesis will evaluation order.
if( ( !empty( $var1 ) || ( !empty( $var2 ) !empty( $var3 ) ) ||
$var1 == something )
However, the $var1==something test is redundant in this, since if that is
true the
I am trying to determine if it is worth my time to attempt a if
statement similar to the following. I am asking because I have not
found any references to something like this:
if( ( !empty( $var1 ) ) || ( if( !empty( $var2 ) ) ( !empty( $var3 )
) ) || ( $var1 == something ) ) {
// do
You only need one if. The parenthesis will evaluation order.
if( ( !empty( $var1 ) || ( !empty( $var2 ) !empty( $var3 ) ) ||
$var1 == something )
On Nov 3, 2005, at 10:13 AM, Jason Gerfen wrote:
I am trying to determine if it is worth my time to attempt a if
statement similar to the
Murray, Miles, Cristea Jim: Thanks a lot, I got it figured out. Peace, -z
Hello everyone,
I'm using a while loop to display a list of people contained in my
database.
I'd like to assign different font colors to each depending on which city
they're from, but I can't seem to get an
1 - 100 of 338 matches
Mail list logo