thanks.
Ross [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Can I put post values directly into insert statements?
$query = INSERT INTO categories (category_name) VALUES
('$_POST['cat_name']);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
None of the previous posts added any security...
They all ONLY provided different syntax to leave your database wide
open for abuse.
This is much safer:
$cat_name_sql = myqsl_real_escape_string($_POST['cat_name']);
$query = insert into categories (category_name) values
('$cat_name_sql');
You
It works now: I replaced the last part of the sql with a variable
?php
$sql = SELECT COUNT(*) FROM leaderboard WHERE points = $my_points ;
$result = mysql_query( $sql ) or die ( mysql_error() );
$rank = mysql_result( $result, 0 );
echo $rank;
?
Bigmark [EMAIL PROTECTED] wrote in message
It works now: I replaced the last part of the sql with a variable
?php
$sql = SELECT COUNT(*) FROM leaderboard WHERE points = $my_points ;
$result = mysql_query( $sql ) or die ( mysql_error() );
$rank = mysql_result( $result, 0 );
echo $rank;
?
Bigmark [EMAIL PROTECTED] wrote in message
Here's a link to a series of 4 articles that explain aggregation in
PHP.as this sounds like what you want to do.
http://www.devshed.com/c/a/PHP/Object-Interaction-in-PHP-Introduction-to-Aggregation-part-1/
HTH
Steve
Graham Anderson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Here's a link to a series of 4 articles that explain aggregation in
PHP.as this sounds like what you want to do.
http://www.devshed.com/c/a/PHP/Object-Interaction-in-PHP-Introduction-to-Aggregation-part-1/
HTH
Steve
Graham Anderson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Richard Lynch schrieb:
Does anybody have a rational explanation for what purpose in life the
following syntax is considered acceptable?
?php
$query = UPDATE whatever SET x = 1;
$query;
?
Well from PHPs point of view this is not a syntax error.
Note that the line with just $query; on it
* Steve Turnbull [EMAIL PROTECTED]:
Is there a class or some code out there which enables you to print your
PHP code to a web page and make it appear with syntax highlighting?
As an example of what I am after, have a look here;
http://www.phpfreaks.com/phpmanual/page/function.ldap-add.html
George B wrote:
George B wrote:
I am trying to connect to a datbase:
mysql_select_db ('database')
or die (couldnt connect to databse)
What is wrong here?
This is the error:
Parse error: syntax error, unexpected T_STRING in file name on line 12
this code works though
the semicolon
George B wrote:
I am trying to connect to a datbase:
mysql_select_db ('database')
or die (couldnt connect to databse)
What is wrong here?
This is the error:
Parse error: syntax error, unexpected T_STRING in file name on line 12
this code works though
$db = mysql_connect(localhost,
Jason Barnett wrote:
Jake, as you probably already know you usually have to give the class
name when attempting to get a static variable, i.e.
YourClassName::$bob;
You *can* dynamically refer to a static class variable from within an
object without knowing the name of the class; this is what
hi,
it's a limitation, and not allowed in PHP. There was a whole line of
posts about it in internals.
- Tul
Jake Press wrote:
Hello All,
I am having an interesting syntax problem. :(
I have been battling this little bugger for the last week and a half, I
have exhausted google and numerous php
Thanks Tul,
Okay, so its a limitation :(
I cant find the line of posts, any idea on it - or possible keywords i
can google with ?
I'd like to find out the reasons behind why this a fixed limitation
Best Regards
Jake Press
M. Sokolewicz wrote:
hi,
it's a limitation, and not
Jake, as you probably already know you usually have to give the class name when
attempting to get a static variable, i.e.
YourClassName::$bob;
You *can* dynamically refer to a static class variable from within an object
without knowing the name of the class; this is what self is for. i.e.
Aaron Gould wrote:
Could any of you privide some leads in regard to highlighting syntax of
an odd language? I have a large amount of snippits of legacy code from
our company's primary application. The code used is BBx (a variant of
Basic).
I'm attempting to show this code on a web page, but
If you want to actually want the variables $flyertotal, $emailtotal, and
$phonetotal, use the line:
${$array[0].total} = $row[0];
But as you defined $array, that will actually create the variables
$Flyertotal, $Emailtotal, and $Phonetotal (note the caps).
On 2/13/2004 6:10 AM, Bob pilly
Richard Davey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I'm after a technique/method that will allow me to syntax highlight
source code on my web site. PHP already does a brilliant job of this
for PHP code, but I need to extend this to ANY form of source code.
Try
By the way, beware of possibly buggy code:
strpos() will return 0 if the string begins with '-', but it will return
FALSE if '-' is not found in the string.
Since both 0 and FALSE will evaluate to boolean false in your condition, you
may get weird results.
Use this instead: (strpos($a, '-') !==
SELECT * FROM ad AS t1
Where is the table?
Should be like:
SELECT ad AS t1 FROM table_name Where .. Limit 0,n
Coskun SUNALI / Turkey
Pablo Oliva [EMAIL PROTECTED] wrote in message
000101c2726e$c506ee50$6a6c0444@cr8tivewerk">news:000101c2726e$c506ee50$6a6c0444@cr8tivewerk...
Can anyone
Thank you.
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
If memory serves, $match will contain an array whose 0th element is the
entire string and whose 1st element contains whatever is matched in the
first (), 2nd element matches the second () and so on.
Check the manpage for more...
and when testing things like this out try adding the following for
first of all your data seems to come from a DB to me. If it's so then read
your DB manual for date functions. It would be way better and faster.
Otherwise, if you're so keen to let this duty job up to PHP then convert
both dates into UNIX time format 'maketime()' deduct the values and put
Okay, I've got 2 tables. One has fields user, exp_date, the other has a
bunch of fields including user. If the exp_date from the first table is
greater than $somedate (probably today's date), then I don't want to
show the records from the 2nd table. Get it?
So how do I do this?
It doesn't
: [EMAIL PROTECTED]
Subject: [PHP] Re: syntax for date math expressions
Okay, I've got 2 tables. One has fields user, exp_date, the other has a
bunch of fields including user. If the exp_date from the first table is
greater than $somedate (probably today's date), then I don't want to
show
Hey,
if (isset($submit)){
if (!empty($qty))
{ echo Please enter the quantity for your quotation enquiry.;}
When nothing was filled in for $qty the if condition did not prompt me to
enter a quantity.
This is wrong:
if (!empty($qty))
{ echo Please enter the
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Peter) wrote:
for example
if ($email ==)
checks if the $email variable was inputted by the user.
Better: if(!empty($email))
http://php.net/empty
However I was wondering how can I refine it so that it will also check if
the $email
Thanks for your reply.
But I tried it and it seems to pass right through the if condition without
checking if the string is empty or not. Here is another PHP file where I
tried using the empty function
The input form contains the following:
h2QTY:/h2input type=text name=qty size=7br
Here is
If you don't put fields name as in: INSERT INTO news VALUES(, )
this means you are going to give values to all the fields in the table (in
their order).
If you specify fields after table name: news(body, date) this means VALUES()
would be adding to these specific fields...
now as for
Hi..
I just wanna laugh really want to laugh WUWUAHAHAHAHAHA
I have figure out the solution amazingly! here will be the code I am running
LoL
?
mysql_connect('localhost','coconut','tkming') or die (Unable to connect to SQL
Server);
mysql_select_db('helpwatch') or die (Unable to
At 06.08.2001 10:31, you wrote:
Hi..
I just wanna laugh really want to laugh WUWUAHAHAHAHAHA
I have figure out the solution amazingly! here will be the code I am
running
LoL
it works without separating the code if you add the ; at the end of the
$temp = $username.watch line...
Hello !
We could keep things simpler ...
Why not give a try to this ?:
$watchlist_query = mysql_query( Create Table $temp ( WId int Not
Nullauto_increment, QId int not null, Primary Key (WId) ) ) or die (Error
! Cannot create table ! . mysql_error() );
Hope it would work :o)
(At least the
Uh...this is just a guess, but could it be the line endings are
confusing PHP? Perhaps you have DOS formatted files in Unix or Unix
files in DOS or Mac files in DOS or DOS files in Mac or ...you get the
idea... That is, in DOS lines are ended by \n\r, in Unix by \n, and in
Mac by \r. Lacking
32 matches
Mail list logo