[PHP] Re: syntax question

2007-03-26 Thread Ross
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:

Re: [PHP] Re: syntax question

2007-03-26 Thread Richard Lynch
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

[PHP] Re: syntax error help

2006-08-20 Thread Bigmark
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

[PHP] Re: syntax error help

2006-08-20 Thread Bigmark
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

[PHP] Re: Syntax to call a class' methods in your own class

2006-05-24 Thread Stephen Lake
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]

[PHP] Re: Syntax to call a class' methods in your own class

2006-05-24 Thread Stephen Lake
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]

[PHP] Re: Syntax Oddity

2006-05-02 Thread Barry
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

[PHP] Re: syntax highlighting your php code on a web page

2005-08-04 Thread Matthew Weier O'Phinney
* 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

Re: [PHP] Re: syntax error, unexpected T_STRING

2005-07-18 Thread Jochem Maas
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

[PHP] Re: syntax error, unexpected T_STRING

2005-07-18 Thread George B
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,

Re: [PHP] Re: Syntax problem - dynamic static member access

2004-11-07 Thread Jake Press
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

[PHP] Re: Syntax problem - dynamic static member access

2004-11-07 Thread M. Sokolewicz
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

Re: [PHP] Re: Syntax problem - dynamic static member access

2004-11-07 Thread Jake Press
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

[PHP] Re: Syntax problem - dynamic static member access

2004-11-06 Thread Jason Barnett
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.

[PHP] Re: Syntax highlighting of odd language

2004-11-05 Thread M. Sokolewicz
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

[PHP] Re: syntax help

2004-02-13 Thread John Kaspar
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

[PHP] Re: Syntax Highlighting

2004-01-06 Thread Al
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

[PHP] Re: syntax question

2003-03-06 Thread Niels Andersen
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, '-') !==

[PHP] Re: syntax error on mysql select statement

2002-10-13 Thread Coskun SUNALI
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

[PHP] Re: syntax question - eregi()

2002-09-20 Thread Anthony Ritter
Thank you. TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: syntax question - eregi()

2002-09-19 Thread Philip Hallstrom
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

[PHP] Re: syntax for date math expressions

2002-04-03 Thread Maxim Maletsky
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

[PHP] Re: syntax for date math expressions

2002-04-03 Thread ROBERT MCPEAK
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

RE: [PHP] Re: syntax for date math expressions

2002-04-03 Thread Rick Emery
: [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

Re: [PHP] Re: syntax for checking if string contains something

2001-10-23 Thread liljim
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

[PHP] Re: syntax for checking if string contains something

2001-10-22 Thread CC Zona
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

Re: [PHP] Re: syntax for checking if string contains something

2001-10-22 Thread Peter
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

[PHP] Re: syntax?

2001-09-13 Thread _lallous
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

[PHP] Re: syntax help~~~

2001-08-06 Thread Coconut Ming
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

Re: [PHP] Re: syntax help~~~

2001-08-06 Thread Andreas D. Landmark
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...

[PHP] Re: syntax help~~~

2001-08-05 Thread Arcadius A.
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

[PHP] Re: Syntax Error On Line 1

2001-07-31 Thread Andrew Sterling Hanenkamp
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