will not have any slashes embedded in normal
> circumstances, so there is no reason to stripslashes() any data coming from
> a database column...
>
> Rich
> -Original Message-
> From: Dash McElroy [mailto:dash.php@;westonefcu.org]
> Sent: 08 November 2002 16:53
> To:
Elroy [mailto:dash.php@;westonefcu.org]
Sent: 08 November 2002 16:53
To: 'Zeus'; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] mysql_fetch_array problem
Zeus,
2 notes:
1. Data you insert into a database should be addslashes($varname) first (or
another encoding) to protect against MySQL injection vulnerab
eif ($count == 0) {
echo "No results returned";
}
else {
echo "Invalid Query. MySQL error: ".mysql_error();
}
Please note - this code is off the top of my head, I have not actually tried
it :)
-Dash
-Original Message-
From: Zeus [mailto:zeus_
I try to display mysql database using fetch_array but there seem to problem,
i m new with PHP and mysql.
I didn't quite sure, what's worng with my codes.i havent include the form
yet.
the error messages:
Warning: mysql_fetch_field(): supplied argument is not a valid MySQL result
resource in c:\ap
testing locally I use the following code
$query = "select * from users where UserName LIKE '$username'";
$result = mysql_query($query);
if ($row = mysql_fetch_array($result)) {
...
...
}
works fine.
On the ISP machi
Hi folks,
I'm trying to run an application, made on PHP3/LINUX, on PHP 4.1.2/Windows in module
scheme. But its seems be reclaiming that mysql_fetch_array() function doesn't work at
4.1.2 version. How can i fix it?
[ ]'s
Pajé
System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98
When PHP is running at the line: $arr=mysql_fetch_array($res);
The IE always show info as below:
"Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
group\apache\htdocs\web\
Look at the line number indicated by the error. A parse error has nothing to do with
the mysql functions. Your code looks fine. What did you leave out with the ...'s?
By the way, an easier way to do what you're doing here is:
$res = mysql_query($query);
while ($arr = mysql_fetch_array($res))
System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98
http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Thats it, I used the array solution which means I can directly call the
specific variable outside the while loop. thanks again.
Andrew
-Original Message-
From: Michael Rudel [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 16:15
To: 'Andrew.Martin'
Subject: RE: [PHP-WIN] mysql_f
So you have all these values stored in $variable_row[id], right?
Assuming that's what you're saying, do this:
for ($i=0; $i
> I'm using this function to check the value of specific fileds per row in the
> database.
> such as
> $query = "SELECT * FROM $dbn WHERE status = 4";
> $result = mysql
I'm using this function to check the value of specific fileds per row in the
database.
such as
$query = "SELECT * FROM $dbn WHERE status = 4";
$result = mysql_query($query) or die("failed to connect to DB");
while ($row = mysql_fetch_array ($result)) {
print "row id = $row[id]";
12 matches
Mail list logo