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 Thursday 05 May 2005 10:10, Anasta wrote:
Why doesnt this work, it shows the username but not the balance of the
users money.here is the mysql table:
?php session_start();
include(connect.php);
$uname=$_SESSION['username'];
$user_balance=mysql_query($sql);
$sql = Select FROM users
On , 2005-05-08 at 23:16 +0200, Andy Pieters wrote:
Notes:
* just because it comes from SESSION doesn't mean that it cannot be spoofed.
That's why you should escape uname before including it in a query.
Is there something I do not know ? :). As far as I know, it can be
spoofed only if you
On Sun, May 8, 2005 3:20 pm, Josip Dzolonga said:
On нед, 2005-05-08 at 23:16 +0200, Andy Pieters wrote:
Notes:
* just because it comes from SESSION doesn't mean that it cannot be
spoofed.
That's why you should escape uname before including it in a query.
Is there something I do not know ?
Why doesnt this work, it shows the username but not the balance of the users
money.here is the mysql table:
CREATE TABLE `users` (
`user_id` int(11) NOT NULL auto_increment,
`username` varchar(15) NOT NULL default '',
`password` varchar(15) NOT NULL default '',
`status` varchar(10) NOT
On 5/5/05, Anasta [EMAIL PROTECTED] wrote:
Why doesnt this work, it shows the username but not the balance of the users
money.here is the mysql table:
CREATE TABLE `users` (
`user_id` int(11) NOT NULL auto_increment,
`username` varchar(15) NOT NULL default '',
`password` varchar(15)
Maybe the query should be
select user_balance FROM users WHERE user_id=$uname;
Prathap
-- Original Message ---
From: Anasta [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Thu, 5 May 2005 16:10:35 +0800
Subject: [PHP] select statement
Why doesnt this work, it shows
Hi all,
I want to select some records with e.g. ID's 1,3,7 and 8
How can this be done best?
is it: SELECT * FROM myTable WHERE ID=1,3,7,8 ??
thx. Wilbert
-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL
:20 AM
To: [EMAIL PROTECTED]
Subject: [PHP] select statement
Hi all,
I want to select some records with e.g. ID's 1,3,7 and 8
How can this be done best?
is it: SELECT * FROM myTable WHERE ID=1,3,7,8 ??
thx. Wilbert
-
Pas de Deux
Van Mierisstraat 25
On Thursday 16 May 2002 19:19, Wilbert Enserink wrote:
Hi all,
I want to select some records with e.g. ID's 1,3,7 and 8
How can this be done best?
is it: SELECT * FROM myTable WHERE ID=1,3,7,8 ??
Is this a PHP question?
--
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open
lto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 2:30 PM
To: PHP MAIL GROUP
Subject: [PHP] SELECT statement
Hi,
Can you have a SELECT statement (using mysql) that goes something like
$sql="SELECT id email FROM table WHERE user='$user' and pass='$pass'";
and if you can't is
r shows up but again email does not
}
?
/body
/html
-Original Message-
From: Philip Olson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 4:59 PM
To: Peter Houchin
Cc: PHP MAIL GROUP
Subject: RE: [PHP] SELECT statement
A possible way to find out :
$result = mysql_query($
");
// if successful then do this
if ($num == 1) {
include "quote2.php"; //has a hidden field referencing the user the email
address .. user shows up but again email does not
}
?
/body
/html
-Original Message-
From: Philip Olson [mailto:[EMAIL PROTECTED]]
Sent
Hi,
Can you have a SELECT statement (using mysql) that goes something like
$sql="SELECT id email FROM table WHERE user='$user' and pass='$pass'";
and if you can't is there a away around this?
Thanks
Peter
Assuming you want to select both id and email from table, use commas :
SELECT id,email FROM ...
Also, check out this basic SQL tutorial :
http://www.sqlcourse.com/
It's fairly useful.
regards,
Philip
On Tue, 13 Feb 2001, Peter Houchin wrote:
Hi,
Can you have a SELECT statement
On Tue, 13 Feb 2001 16:00, Peter Houchin wrote:
Hi,
Can you have a SELECT statement (using mysql) that goes something like
$sql="SELECT id email FROM table WHERE user='$user' and
pass='$pass'";
and if you can't is there a away around this?
Thanks
Peter
In SQL queries, you normally
ok I've changed my code to
$sql = "SELECT id, email FROM users WHERE user='$user' and pass='$pass'";
but still no joy can any one suggest why?
( Yes email is a field in the table)
Peter
Hi,
Can you have a SELECT statement (using mysql) that goes something like
$sql="SELECT id
A possible way to find out :
$result = mysql_query($sql) or die(mysql_error());
Does it say anything? mysql_error() is your friend, it can be printed
anywhere within the script and will print the last mysql error. So
perhaps :
print mysql_error();
Right before the query or ...
24 matches
Mail list logo