Re: [PHP-DB] Really Good PHP editor

2005-07-06 Thread Brad Webb
Download, unzip, run :) The 3.0 line runs and installs much nicer than 
previous versions... it has some really nice PHP-specific stuff that 
PHP|Eclipse adds.. only bug that I've found with it, is that it hates 
(i.e. doesn't work with AT ALL) Interfaces, which is kind of a pain and 
makes for slightly uglier code.


Ross Honniball wrote:

I'd love to try eclipse but I've heard its really difficult just to 
install and a bit difficult to get the hang of as well. Did you have 
any problems getting started with it? Do you use it on a windows 
platform?


Incidently, yesterday I downloaded a new editor 'PHP Designer 2005' 
from www.mpsoftware.dk/phpdesigner.php. Its free and looks very slick 
and feature rich. Being as new as it is its a little buggy right now, 
but certainly worth keeping an eye on.


Brad Webb wrote:


I'm a big fan of Eclipse + PHP|Eclipse.

Bastien Koert wrote:


Zend is pretty close to what you want

Bastien


From: Ross Honniball [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Really Good PHP editor
Date: Tue, 05 Jul 2005 17:55:49 +1000

Hi All,

Not a DB question, but this is the only list I'm subscribed to, OK? 
Besides, everyone uses some kind of editor.


I'm presently using PSPAD as a PHP code editor which is very usable 
and has a lot of features that I love and use every day.


However it doesn't do everything I'd like it to.

I'd like an editor smart enough to resolve require_once(), 
include_once() etc.  statements so that it can build a tree or at 
least some kind of list of the various included scripts starting 
from a base script.


Also it would be nice if it could figure out where a function was 
defined and you could just double click on the function name and it 
would take you straight to it. In fact, it would be even nicer if 
it could be smart enough to advise you the arguments as you type 
for both built-in and custom written functions and classes. I'm 
drooling just thinking about it.


Am I dreaming thinking I will find this kind of functionality in a 
free editor? Is there a reasonably priced one people know of that 
do this kind of thing (and more)?


Thanks ... Ross

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php









--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Really Good PHP editor

2005-07-05 Thread Brad Webb

I'm a big fan of Eclipse + PHP|Eclipse.

Bastien Koert wrote:


Zend is pretty close to what you want

Bastien


From: Ross Honniball [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Really Good PHP editor
Date: Tue, 05 Jul 2005 17:55:49 +1000

Hi All,

Not a DB question, but this is the only list I'm subscribed to, OK? 
Besides, everyone uses some kind of editor.


I'm presently using PSPAD as a PHP code editor which is very usable 
and has a lot of features that I love and use every day.


However it doesn't do everything I'd like it to.

I'd like an editor smart enough to resolve require_once(), 
include_once() etc.  statements so that it can build a tree or at 
least some kind of list of the various included scripts starting from 
a base script.


Also it would be nice if it could figure out where a function was 
defined and you could just double click on the function name and it 
would take you straight to it. In fact, it would be even nicer if it 
could be smart enough to advise you the arguments as you type for 
both built-in and custom written functions and classes. I'm drooling 
just thinking about it.


Am I dreaming thinking I will find this kind of functionality in a 
free editor? Is there a reasonably priced one people know of that do 
this kind of thing (and more)?


Thanks ... Ross

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Can someone help me out?

2005-06-07 Thread Brad Webb


Is your query wrapped in single quotes, instead of double quotes? 
Variable expansion, of course, doesn't occur under single quotes. :)


ReClMaples wrote:


I am having a problem getting a sql statement to run.

I have this in a table called stat_categories, in a field called sql2

select a.name,a.position,a.team,sum(b.yards) as Results from player
a,passing b
where
a.player_num = b.player_num
and a.position = '$pos'
and b.year = '$year'
group by a.name
order by Results desc
limit '$display'

when I try to display this I get this error:

You have an error in your SQL syntax. Check the manual that corresponds to
your MySQL server version for the right syntax to use near ''$display'' at
line 8

I tried removing the s but this didnt help.

If I put in the sql instead of the variable, it works fine.  What am I doing
wrong?

Any help would be greatly appreciated.

Thanks
-Rich

 



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Can someone help me out?

2005-06-07 Thread Brad Webb
eval($recss[sql1]).. variables inside a string have to be expanded 
manually, since you're storing the variable names inside the DB, you 
have to manually pull them out..


Sorry for not catching this earlier, I didn't realize the query itself 
was stored in the DB.



ReClMaples wrote:


All,

  Here is the code that I'm using.  I have a form that feeds that top
values to this page:

?php

$pos = $_POST['sel_pos_name'];
$year = $_POST['sel_year_name'];
$cat_name = $_POST['sel_cat_name'];
$display = $_POST['display'];
$div = $_POST['Div'];


//MySql and Database Connection
$conn = mysql_connect(, , ) or die(mysql_error());
mysql_select_db(,$conn)  or die(mysql_error());


//Gets the id,cat_name,sql1 field sql2 field and cat_descript from the table
$get_cat_info = select Id,Cat_Name,Cat_Descript,sql1,sql2 from
stat_categories where Cat_Name = '$cat_name';
$get_cat_info_res = mysql_query($get_cat_info) or die(mysql_error());

while ($recss = mysql_fetch_array($get_cat_info_res))
{
   $id = $recss['Id'];
   $cat_name1 = $recss['Cat_Name'];
   $cat_descript = $recss['Cat_Descript'];
   $sql1 = $recss['sql1'];
   $sql2 = $recss['sql2'];
}

//Displays the top of the table
echo bResults for $cat_name/b;
echo table border='1' cellpadding='1' cellspacing='1';
echo tr;
echo td bgcolor=\#C0C0C0\centerbPlayer Name/b/center/td;
echo td bgcolor=\#C0C0C0\centerbPosition/b/center/td;
echo td bgcolor=\#C0C0C0\centerbTeam/b/center/td;
echo td bgcolor=\#C0C0C0\centerb$cat_descript/b/center/td;
echo /tr;

if ($div == 'NFL')
{
//sql2

$get_results = $sql2 limit $display;

//echo $get_results;

$get_results_res = mysql_query($get_results) or die(mysql_error());

while ($res = mysql_fetch_array($get_results_res))
{
$player_name = $res['name'];
$position = $res['position'];
$team = $res['team'];
$Results = $res['Results'];

echo tr;
echo tdcenter$player_name/center/td;
echo tdcenter$position/center/td;
echo tdcenter$team/center/td;
echo tdcenter$Results/center/td;
echo /tr;
echo /table;


}

}
else
{
//sql1

$get_resultss = $sql1  limit $display;

echo $get_results1;
$get_results_res1 = mysql_query($get_results1) or die(mysql_error());

while ($res1 = mysql_fetch_array($get_results_res1))
{
$player_name = $res1['name'];
$position = $res1['position'];
$team = $res1['team'];
$Results = $res1['Results'];

echo tr;
echo tdcenter$player_name/center/td;
echo tdcenter$position/center/td;
echo tdcenter$team/center/td;
echo tdcenter$Results/center/td;
echo /tr;
echo /table;

}
}

?

There are no functions and I'm using double quotes.  In my table.  I have
two fields sql1 and sql2.

Here are the values in each of the fields:

Sql1
select a.name,a.position,a.team,sum(b.yards) as Results from player
a,passing b
where
a.player_num = b.player_num
and a.position = '$pos'
and b.year = '$year'
and a.team_div = '$div'
group by a.name
order by Results desc

Sql2
select a.name,a.position,a.team,sum(b.yards) as Results from player
a,passing b
where
a.player_num = b.player_num
and a.position = '$pos'
and b.year = '$year'
group by a.name
order by Results desc

I'm stumped.  I have tested each variable and they all come back, except in
the variables sql1 and sql2.

Thanks
-Rich
-Original Message-
From: Bastien Koert [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 07, 2005 7:21 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Subject: RE: [PHP-DB] Can someone help me out?

can you show the code around it? are you using single quotes in defining the
sql statement? or double quotes?

Bastien

 


From: ReClMaples [EMAIL PROTECTED]
To: Jason Walker [EMAIL PROTECTED]
CC: PHP php-db@lists.php.net
Subject: RE: [PHP-DB] Can someone help me out?
Date: Tue, 7 Jun 2005 19:00:59 -0500

Jason,

  After looking at this a little more, the variable aren't being changed
into their value.

The echo looks like this:

select a.name,a.position,a.team,sum(b.yards) as Results from player
a,passing b where a.player_num = b.player_num and a.position = $pos and
b.year = $year and a.team_div = $div group by a.name order by Results desc
limit '$display'

As you can see the variables aren't being changed, any ideas?

Thanks
-Rich

-Original Message-
From: Jason Walker [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 07, 2005 6:54 PM
To: 'ReClMaples'
Subject: RE: [PHP-DB] Can someone help me out?


In your PHP page, can you echo the actual query variable to the browser and
send that to the mail group?

I don't necessary see anything 'wrong' with your query but see the three
variables, as they are interpreted by PHP, may help.

Thanks,

-Original Message-
From: ReClMaples [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 07, 2005 4:05 PM
To: 

Re: [PHP-DB] Transfering post data to a series of pages.

2005-05-04 Thread Brad Webb
You may also consider using sessions to store form data.. this allows 
for actual user interaction with the data, back/forward etc... as well 
as tracking and other stuff.. you really should only have Page1.php, 
and use a logic object to parse the data from there.. IMHO, of course. :)

[EMAIL PROTECTED] wrote:
Perry, Matthew (Fire Marshal's Office) wrote:
 

Is there a way to transfer post data to a series of PHP pages?
For example, lets say I have the following 4 pages:
Page1.php - this page has my original post form
Page2.php - this page does one thing with the post data
Page3.php - this page does another thing with the post data
Page4.php - this page shows the results of everything I have done
Right now I am using the header: ?header(Location: page3.php);?
The problem is, the following works:
Page1.php - this page has my original post form
Page2.php - this page does one thing with the post data
Page3.php - this page shows the results of everything I have done
But when I try to add the second transfer the data is lost:
Page1.php - this page has my original post form
Page2.php - this page does one thing with the post data
Page3.php - this page does another thing with the post data
Page4.php - Only the results from Page2.php are shown
ASP does this with %Server.Transfer (transferpage1.asp)%
Is there a counterpart with PHP?
- Matthew
   

Martin Norland wrote:
 

include() :P
 

 

seriously though, Page1.php and Page4.php are the only two pages that 
should exist, if any.  Page2 and Page3 should pretty much guaranteed be 
 

 

turned into function calls or classes and called from Page4.php.  You 
don't need to separate logic and display in separate scripts that you 
push everything at, just separate your logic out into function calls.
 


What Martin suggests makes a lot of sense. Can you say something about why 
you have the site design the way that you do?

David
 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php