RE: [PHP] New to PHP, and stuck

2002-11-06 Thread Steve Bradwell
The first thing I do when confronted with this kind of problem is to print
out the sql statement and carefully look through it. So if you have not done
this yet, comment out the $result = statement. Above that add an echo $sql;
Now look through the sql statement and make sure all fields are there and
there is no syntax problem with your query, this is most likley the case. If
you are using mysql I would recommend downloading phpMyAdmin which is a php
GUI interface to mysql, once this is running, you can simply cut and paste
the sql statement into the phpMyAdmin query box and try to run it from
there, it will tell you where your syntax is wrong.

HTH,
Steve Bradwell
MIS Department.

If you give someone a program, you will frustrate them for a day. If
you
teach them how to program, you will frustrate them for a lifetime.


-Original Message-
From: Markus Jäntti [mailto:janmark;bodo.kommune.no]
Sent: Wednesday, November 06, 2002 8:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] New to PHP, and stuck


I'm working myself through Julie C. Meloni's book PHP and now I'm stuck at
chapter 12.
My script gives me this error:  You have an error in your SQL syntax near
'()' at line 1
even tho I've even tried replacing my own work with the file from the book's
companion-files.
I'd be very happy if someone would take the time to look through this and
tell me what the problem might be. Hard to move forward when I don't
understand this.

Here's the script:


?
//indicate the database you want to use
$db_name =testDB;

//connect to database
$connection = @mysql_connect(localhost,john,doe99) or
die(mysql_error());
$db = @mysql_select_db($db_name,$connection) or die(mysql_error());

//start creating the SQL statement
$sql =CREATE TABLE $_POST[table_name] ((;

//continue the SQL statement for each new field
for ($i =0;$i  count($_POST[field_name]);$i++){
 $sql .= $_POST[field_name][$i]..$_POST[field_type][$i];
 if ($_POST [field_length][$i] != ) {
  $sql .= (.$_POST [field_length][$i].),;
 } else {
  $sql .= ,;
 }
}

//clean up the end of the string
$sql = substr($sql,0,-1);
$sql .= );

//execute the query
$result = mysql_query($sql,$connection) or die(mysql_error());

//get a good message for display upon success
if ($result) {
 $msg =P.$_POST[table_name]. has been created!/P;
}

?

HTML
HEAD
TITLECreate a Database Table:Step 3/TITLE
/HEAD
BODY
h1Adding table to ? echo $db_name; ?.../h1

? echo $msg; ?

/BODY
/HTML



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

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




RE: [PHP] Yahoo moves to PHP

2002-10-30 Thread Steve Bradwell
We're taking over.

Steve Bradwell
MIS Department.

If you give someone a program, you will frustrate them for a day. If
you
teach them how to program, you will frustrate them for a lifetime.


-Original Message-
From: Nick Wilson [mailto:nick;tioka.com]
Sent: Wednesday, October 30, 2002 8:13 AM
To: php-general
Subject: [PHP] Yahoo moves to PHP


Forgive me if you guys have seen this. Just read it on
www.webmasterworld.com

Yahoo moves to PHP 
http://public.yahoo.com/~radwin/talks/yahoo-phpcon2002.htm
-- 
Nick Wilson //  www.tioka.com




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

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




RE: [PHP] Re: Multiple Inheritance Emulation

2002-09-27 Thread Steve Bradwell

LOL, thanks for the laugh on a friday afternoon =].

-Original Message-
From: Julio Nobrega [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 27, 2002 3:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Multiple Inheritance Emulation


Julio Nobrega em Friday 27 September 2002 15:40 foi agraciado com uma 
resposta por:

 I don't fully understand OOP, so my snippet might be wrong. But I need to
 emulate Multiple Inheritance for a script, so I've made the following,
 which I ask for opinions since I am not so sure if it will always work.

 Er.. list, nevermind. What I did doesn't make any sense at all. Sorry for 
wasting everybody time and bandwidth.

-- 
Julio Nobrega
http://gnet.inerciasensorial.com.br

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

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




RE: [PHP] Getting started with PHP

2002-09-26 Thread Steve Bradwell

Welcome Steve,

You'll need to do two things to get started, download apache and php for
windows, and configure 2 files - httpd.conf (apache), and php.ini. A good
tutorial can be found here :

http://softwaredev.earthweb.com/script/article/0,,12014_912381,00.html

After that create a .php file in apache's /htdocs dir (which is where you
will put your pages), the file should look like this:

?
phpinfo();
?

This will show you all of php's configuration settings.

From there the world is your oyster ;)

HTH,
Steve.

-Original Message-
From: Sauron [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 12:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting started with PHP


Hi all

I am brand new to PHP, I have a friend that develops in it and I'm
interested in learning more about it. I am familiar with VB at the moment
and that's about it, but I'm always willing to learn!!

What do I need to get developing using PHP? I want to develop completely on
my machine rather than upload files to a web server. I have W2K installed.

Any help is much appreciated,

Regards,

Steve.




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

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




RE: [PHP] ADOdb

2002-09-24 Thread Steve Bradwell

One thing that has helped me was to write a db class and use it to connect
to mysql, then all you have to do is change the class, and not all your code
when you change the db.
-Steve

-Original Message-
From: Brendon G [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 4:03 AM
To: [EMAIL PROTECTED]
Subject: [PHP] ADOdb


Just curious as to what the general consensus of opinion is on the following
class.  Do many of you use it?.
http://php.weblogs.com/ADOdb

Coming over to PHP from ASP (I'm not really interested in learning .Net at
the moment) I like that I can switch databases allot faster if the need
occurs by using ADOdb.  If I had written code just using MySQLconnect I'd
have a hell of a time in the future.

Cheers

Brendon


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

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




RE: [PHP] MySQL vs. basic text file

2002-09-23 Thread Steve Bradwell

Well, one major advantage I have found using MySQL verses txt files is the
simple implementation of transactions, if you are doing multiple
transactions that are related, it is nice to simply rollback all other
statements if one fails or commit if they work. Of course you can do this
other ways but the simplicity is nice. Although I am still a newbie, I would
also have to say there would be a speed issue, if you only wan't one row
returned versus reading enire file into memory then walking through it one
at a time, mysql's indexing can greatly speed this process up.
HTH,
Steve.

-Original Message-
From: Doug Parker [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 21, 2002 7:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL vs. basic text file


often i use text files at my data sources, delimted by the | symbol. 
i simply delimit the fields of each line, then when i need to open them, 
i open the text file, populate an array with each line, then explode the 
fields for each to get the corresponding values.   i use this method for 
catalogs - and even backend interfaces, for which the client can 
add/edit/delete products.  everything seems to be working fine, and 
there doesn't seem to be a need for MySQL or anything.  i was wondering 
if there is anything i'm not thinking of that perhaps would push me to 
favor using php and mysql instead of the plain old text file.



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

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




RE: [PHP] editor php

2002-09-19 Thread Steve Bradwell

Lol. Here, Here!

-Original Message-
From: Adam Williams [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 19, 2002 11:06 AM
To: Gian Michele
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] editor php


/bin/vi

:)

Adam

On Thu, 19 Sep 2002, Gian Michele wrote:

 Hi,
 does any body knows a cool editor for php that run under redhat 7.x and
 where i can find?
 tanks  -- Gian Michele





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

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




RE: [PHP] PHP and Microsoft Office

2002-09-18 Thread Steve Bradwell

Yes you can,

check http://www.php.net/manual/en/ref.com.php for examples.

HTH,
Steve.


-Original Message-
From: Matthew Tapia [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 17, 2002 9:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP and Microsoft Office


Can you use PHP to add appts to my microsoft outlook calendar or open up a
document in ms word?





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

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




RE: [PHP] RE: A straightforward user login coding

2002-09-09 Thread Steve Bradwell

Hey there,

This is a page I wrote that does that with sessions, sorry its a little
messy but it should help you with the general idea.

HTH,
Steve.


//Copy the below into a php file and change all the variables and sql
statement to reflect your own data.

?
session_start();
if(isset($level)) session_destroy();
if (isset($submitbutton)):
$dbname   = 'put yours here';
$hostname = 'put yours here';
$username = 'put yours here';
$password = 'put yours here';
$table = 'put yours here';

$id_link = mysql_connect($hostname, $username, $password);

if (!$id_link  || !mysql_select_db($dbname)):
echo 'htmlheadtitleError/title/headbody';
echo '1:Connection to PHP has failed.';
echo '/body/html';
exit();
endif;


$login_query = SELECT l.LEVEL, l.Name, s.PLANT, s.Super_Index, p.PLANT as
itemtable FROM Master.login l;
$login_query.=  INNER JOIN Master.supervisors s ON l.Paswd_Index =;
$login_query.=  s.Login_Index INNER JOIN Master.plant_code p ON s.PLANT =
p.PLANT_CODE;
$login_query.=  WHERE l.USER='$user' AND l.PASSWORD='$pwd';

$class_login = mysql_db_query($dbname,$login_query,$id_link) or die(Please
contact HR to be added to supervisors list.);

while ($login_arr = mysql_fetch_array($class_login)):
 $level = $login_arr['LEVEL'];
 $Name = $login_arr['Name'];
 $Location = $login_arr['PLANT'];
 $Super = $login_arr['Super_Index'];
 $Items_Table = Stores.items_.$login_arr['itemtable'];
endwhile;
if (isset($level)){
session_start();
session_register(level);
session_register(Name);
session_register(Super);
session_register(Location);
session_register(Items_Table);
$page = main.php?option=vieworders;
header(Location: $page);
}
 else
  echo div align=centerh3font color=redLogin bNOT/b Successful,
Please try again./font/h3/div;
endif;
?
link rel=stylesheet href=nice.css type=text/css
html
body bgcolor=#F5F5F5 OnLoad=document.login.user.focus();
divnbsp;/div
p
p
divnbsp;/div
p
div align=centerh3Enter user/pwd to enter Stores Administration
Panel./h3/div
FORM METHOD=post name=login ACTION=?
echoindex.php?option=vieworders?
table border=0 width=75% align=center
tr
td align=center bgcolor=#FFimg src=../../imgs/LOGO3_18.bmp
height=250 width=500/td
/tr
tr
td bgcolor=#CC align=centernbsp;nbsp;font
color=#00biUser Name: /i/b/fontinput type=text
name=user class=TextBox_b
nbsp;nbsp;font color=#00biPassword: /i/b/fontinput
type=password name=pwd class=TextBox_bnbsp;nbsp;input
type=submit name=submitbutton value=Login class=Button_F/td
/tr
/table
/body
/html

-Original Message-
From: YC Nyon [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 12:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] RE: A straightforward user login coding


I been searching for a user authentication codes all night but got no where
with the results.
Therefore, if someone can tell me where to find
1. a user authentication using Mysql
2. don't use cookies.
3. also a logout script.

my os is windows.

TIA
Nyon


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

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




RE: [PHP] question

2002-09-04 Thread Steve Bradwell

Maybe try somthing like this, write a function containing all your like
statements.

function likeStatements( ){

//write your statements in this function if they are always the same.

}

//then have an if structure like the following that calls that function in a
while loop.

if ( isset($a)  !isset($b) ){
 while ($a){
  likeStatements(); //you could also pass any needed info to the function.
 }
}elseif( isset($b)  !isset($a) ){
 while ($b){
  likeStatements();
 }
}elseif( isset($a)  isset($b) ){
 while ($a  $b){
  likeStatements();
 }
}

HTH,
Steve.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 04, 2002 10:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP] question


I have a php question.

I would like to enter a while loop, but:
I want it to be like this:

when $a has a value, while $a...
when $b has a value, while $b... (same statements as with $a)
when $a has a value, and $b has a value, while $a and $b

this is based on a search system in which the user can enter a, b or a and
b. 

Can you help me with my problem, or help me find someone who can?!

Thanks.

Dore van Hoorn.


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

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




RE: [PHP] check for a number

2002-09-04 Thread Steve Bradwell

is_int($f) will return true if $f is an integer, false otherwise.

Check http://www.php.net/manual/en/function.is-int.php

HTH,
Steve.

-Original Message-
From: Fifield, Mike [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 04, 2002 4:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] check for a number 


I am using  

substr($f, 0, 1); 

to get the first character of a string but what to be able to tell if the
first character is a digit or a letter is there a way to do this?

 

 


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




RE: [PHP] php Transaction question

2002-08-20 Thread Steve Bradwell

Ya that's pretty much it. Just do:

mysql_query(BEGIN);
$sql = Update bla...;
$result = mysql_query($sql);
if($result)
 mysql_query(COMMIT);
else
 mysql_query(ROLLBACK);

HTH
Steve.

-Original Message-
From: Randy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 20, 2002 10:14 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php Transaction question


I know I saw this somewhere before but cannot find the answer

In a php/mysql script  how do a do a transaction

is it like this or is their a better way to do it? 

innodb table method

$query=set autocommitt=0;
mysql_query($query);

$query=select blah from blah;;
mysql_query($query);

$query=update blah where blah;;
mysql_query($query);

$query=committ;;
mysql_query($query);


Thanks

Randy



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

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




RE: [PHP] phpMyAdmin is this possible

2002-08-20 Thread Steve Bradwell

Do you have phpMyAdmin running yet? If so you create new databases with the
click of a button. The first page you see should say Welcome to phpMyAdmin
...ver etc. If you have set phpMyAdmin to run on an existing MySQL install,
the drop down boxes should contain your existing databases if configured
correctly. To create a new database just type the name in the box on the
home page and click create, from there you can create new tables etc.

hth
Steve.

-Original Message-
From: Steve Jackson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 20, 2002 3:12 PM
To: MYSQL; Php-General
Subject: [PHP] phpMyAdmin is this possible


I am new to MySQL and PHP.
Having looked at PHPMyAdmin the GUI I was wondering if it's possible to
create a new database within the system?
If so what are the commands? I ask because I only have one database on my
server and don't want to populate it with different tables, I'd rather have
seperate ones for seperate functions.. Ideas or advice? is the way I am
suggesting better or worse than the way my hosting company expects me to
work?
Thanks in advance.
Steve.


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

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




RE: [PHP] PHP - class question

2002-08-14 Thread Steve Bradwell

I would suggest you write a method (called mydb() for example) that connects
to your database, and if needed, call it from your constructor like:
$this-mydb(); This way you can always reuse the method from other code.

hth,
Steve.

-Original Message-
From: Mark Armendariz [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 14, 2002 2:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP - class question


Hello,  To begin.. i'm new to the list...

I'm trying to learn good practices in OOP based PHP.  I'm actually a bit new
to OOP in general, but I've done quite a bit of reading and playing around
with it in the past couple of months.

What I'm trying to figure out is the proper way to call a class from a
class.  I dont mean by extending the class, but actaully just getting the
functions...

For instance...

I'm trying to connect to a Database (database class) from my gen_XML class.
Do I include the database class in the gen_XML constructor?  Do I set a
gen_XML variable as a database object (i.e. $this-mydb)?

I hope my question makes some sense...

Your help is appreciated...

Mark Armendariz



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

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




RE: [PHP] Submit code

2002-07-16 Thread Steve Bradwell

Well, I'm not sure if this is what your looking for but the simplest way
might be to use JavaScript. Have the second form that you want to post
without a submit button being clicked have an onSubmit event. So on submit
of the first form, javascript will submit the second without the user
clicking a button. Check this link.

http://www.devguru.com/Technologies/ecmascript/quickref/evhan_onsubmit.html

Hope this helps,
-Steve.


-Original Message-
From: MindHunter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 2:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Submit code


I am looking for PHP code that will submit (post) a form automaically to a
ANOTHER php page.  I do not want to press a submit button.  I have found a
class at PHPClasses but it is too complicated for my needs.  What is the
simplest way of doing this?  What is the theoretical approach?

The reason I need this is that I have a table output from a database after
one submits 'n list of variables (form inputs).  I want to update a graph in
another Iframe automatically without clicking on another submit button.

Tx
MH



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

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




RE: [PHP] Classes vs. Functions

2002-07-16 Thread Steve Bradwell

Classes are great for code reusability, I heavily use a MySQL object or
class to make all my conections to a mysql database now and I have included
methods for Transactions.

Its a long one but its the class I use the most and is a great example of
what they are good for.


?
class mysqldb {  //so here define the name of the class.

//set up the object, these are the variables that are accessible by each
instance you create 
// of an object.
var $host;
var $db;
var $dbuser;
var $dbpassword;
var $sql;
var $numberrows;
var $dbopenstatus;
var $dbconnection;
var $qry;
var $result;
var $TransactionSwitch;
/*
Use these functions to get and set the values of this object's
variables. This is good OO practice, as it means that datatype
checking can be completed and errors raised accordingly.

*/

// Property Get  Set these methods are used set class vars and to
retrieve them.

function gethost() {
return $this-dbhost;
}

function sethost($req_host) {
$this-dbhost = $req_host;

}

function getdb() {
return $this-db;
}

function setdb($req_db) {
$this-db = $req_db;
}

function getdbuser() {
return $this-dbuser;
}

function setdbuser($req_user) {
$this-dbuser = $req_user;
}

function getdbpassword() {
return $this-dbpassword;
}

function setdbpassword($req_password) {
$this-dbpassword = $req_password;
}

function getsql() {
return $this-sql;
}

function setsql($req_sql) {
$this-sql = $req_sql;
}

function getnumberrows() {
return $this-numberrows;
}

function setnumberrows($req_numberresults) {
$this-numberesults = $req_numberresults;
}

function setdbconnection($req_dbconnection) {
$this-dbconnection = $req_connection;
}

function getdbconnection() {
return $this-dbconnection;
}

function setTransactionSwitch($switch) {
$this-TransactionSwitch = $switch;
}

function getTransactionSwitch() {
return $this-TransactionSwitch;
}

/*
This is the constructor for the object. In this case I have set
the initial values of a number of the object properties to those
values declared in the global constants.inc. By doing this, I
only need to change the values of these properties for specific
operations, which we will not need to do throughout this example

*/
function mysqldb() {

global $HOST, $DB, $WEBUSER, $WEBPASSWORD;
global $TRUE, $FALSE;

$this-sethost($HOST);
$this-setdb($DB);
$this-setdbuser($WEBUSER);
$this-setdbpassword($WEBPASSWORD);
$this-setdbconnection($FALSE);

}

/*
These are the methods for the object. They provide for opening a
connection to the database, closing a connection and executing a
SELECT query. Of course, these can be expanded upon to allow for
INSERT's, UPDATE's and DELETE's etc...
*/
function opendbconnection() {

global $TRUE, $FALSE;

$this-dbconnection = mysql_connect($this-dbhost,
$this-dbuser, $this-dbpassword);
if ($this-dbconnection == $TRUE) {
$this-db = mysql_select_db($this-db);
$this-setdbconnection($TRUE);
} else {
$this-setdbconnection($FALSE);
return false;
}
return true;
}

function closedbconnection() {

if ($this-dbconnection = $TRUE) {
mysql_close($this-dbconnection);
}

}

function begin( ) {
if ($this-dbconnection == $FALSE) {
$this-opendbconnection();
}
$this-setsql(BEGIN);
$this-qry = mysql_query($this-sql);
if (!$this-qry) {
return false;
} else {
return true;
}
}

function rollback( ) {
if ($this-dbconnection == $FALSE) {
$this-opendbconnection();
}
$this-setsql(ROLLBACK);
$this-qry = mysql_query($this-sql);
if (!$this-qry) {
return false;
} else {
return true;
}
}

function commit( ) {
if ($this-dbconnection == $FALSE) {
$this-opendbconnection();
}
$this-setsql(COMMIT);
$this-qry = mysql_query($this-sql);
if (!$this-qry) {
return false;
} else {
return true;
}
}

function selectquery() {

global $TRUE, $FALSE;

if ($this-dbconnection == $FALSE) {
$this-opendbconnection();
}
$this-qry = mysql_query($this-sql);
if (!$this-qry) {
return false;
} else {
$this-numberrows = mysql_num_rows($this-qry);
if ($this-numberrows  0) {
for($x = 0; $x  

RE: [PHP] Classes vs. Functions

2002-07-16 Thread Steve Bradwell

Yes any vars used in a class have to be defined ahead. Then just write quick
set and get mothods to change them.

And the important thing to remember is $db1-Host; retrieved with
$db1-getHost(); for example contains seperate data then $db2-$Host;

Good luck.  
 

-Original Message-
From: Chris Crane [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 11:40 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Classes vs. Functions


Wow...this is pretty cool.
Do you HAVE to declareall your varibles ahead of time?
Steve Bradwell [EMAIL PROTECTED] wrote in message
57A1618E7109D311A97D0008C7EBB3A1010C8258@KITCHENER">news:57A1618E7109D311A97D0008C7EBB3A1010C8258@KITCHENER...
 Classes are great for code reusability, I heavily use a MySQL object or
 class to make all my conections to a mysql database now and I have
included
 methods for Transactions.

 Its a long one but its the class I use the most and is a great example of
 what they are good for.


 ?
 class mysqldb {  //so here define the name of the class.

 //set up the object, these are the variables that are accessible by
each
 instance you create
 // of an object.
 var $host;
 var $db;
 var $dbuser;
 var $dbpassword;
 var $sql;
 var $numberrows;
 var $dbopenstatus;
 var $dbconnection;
 var $qry;
 var $result;
 var $TransactionSwitch;
 /*
 Use these functions to get and set the values of this object's
 variables. This is good OO practice, as it means that datatype
 checking can be completed and errors raised accordingly.

 */

 // Property Get  Set these methods are used set class vars and to
 retrieve them.

 function gethost() {
 return $this-dbhost;
 }

 function sethost($req_host) {
 $this-dbhost = $req_host;

 }

 function getdb() {
 return $this-db;
 }

 function setdb($req_db) {
 $this-db = $req_db;
 }

 function getdbuser() {
 return $this-dbuser;
 }

 function setdbuser($req_user) {
 $this-dbuser = $req_user;
 }

 function getdbpassword() {
 return $this-dbpassword;
 }

 function setdbpassword($req_password) {
 $this-dbpassword = $req_password;
 }

 function getsql() {
 return $this-sql;
 }

 function setsql($req_sql) {
 $this-sql = $req_sql;
 }

 function getnumberrows() {
 return $this-numberrows;
 }

 function setnumberrows($req_numberresults) {
 $this-numberesults = $req_numberresults;
 }

 function setdbconnection($req_dbconnection) {
 $this-dbconnection = $req_connection;
 }

 function getdbconnection() {
 return $this-dbconnection;
 }

 function setTransactionSwitch($switch) {
 $this-TransactionSwitch = $switch;
 }

 function getTransactionSwitch() {
 return $this-TransactionSwitch;
 }

 /*
 This is the constructor for the object. In this case I have set
 the initial values of a number of the object properties to those
 values declared in the global constants.inc. By doing this, I
 only need to change the values of these properties for specific
 operations, which we will not need to do throughout this example

 */
 function mysqldb() {

 global $HOST, $DB, $WEBUSER, $WEBPASSWORD;
 global $TRUE, $FALSE;

 $this-sethost($HOST);
 $this-setdb($DB);
 $this-setdbuser($WEBUSER);
 $this-setdbpassword($WEBPASSWORD);
 $this-setdbconnection($FALSE);

 }

 /*
 These are the methods for the object. They provide for opening a
 connection to the database, closing a connection and executing a
 SELECT query. Of course, these can be expanded upon to allow for
 INSERT's, UPDATE's and DELETE's etc...
 */
 function opendbconnection() {

 global $TRUE, $FALSE;

 $this-dbconnection = mysql_connect($this-dbhost,
 $this-dbuser, $this-dbpassword);
 if ($this-dbconnection == $TRUE) {
 $this-db = mysql_select_db($this-db);
 $this-setdbconnection($TRUE);
 } else {
 $this-setdbconnection($FALSE);
 return false;
 }
 return true;
 }

 function closedbconnection() {

 if ($this-dbconnection = $TRUE) {
 mysql_close($this-dbconnection);
 }

 }

 function begin( ) {
 if ($this-dbconnection == $FALSE) {
 $this-opendbconnection();
 }
 $this-setsql(BEGIN);
 $this-qry = mysql_query($this-sql);
 if (!$this-qry) {
 return false;
 } else {
 return true;
 }
 }

 function rollback( ) {
 if ($this-dbconnection == $FALSE) {
 $this-opendbconnection();
 }
 $this-setsql(ROLLBACK);
 $this-qry = mysql_query($

RE: [PHP] RE: ############

2002-07-09 Thread Steve Bradwell

agreed.

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 09, 2002 3:51 PM
To: [EMAIL PROTECTED]
Subject: [PHP] RE: 


lets all spam Erik

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




[PHP] confused newbie on PHP and Javascript.

2002-06-13 Thread Steve Bradwell

Hello All,

I am having a problem, mostly concept wise of how, or if I can use client
side Javascript in a server side php statement.

I have a JavaScript function that onChange of a list box, takes the value of
an option and grabs data from a MySQL table. My problem is how do I use the
JavaScript var in my sql statement?

Here is the function.

function Modify_Item_Details(){

var test =
document.forms[0].item.options[document.forms[0].item.selectedIndex].text;

?
$sql = Select i.QTY_ON_HAND, u.UNIT from items i INNER JOIN;
$sql.=  units u ON i.Unit_Index = u.Unit_Index;
$sql.=  where i.Item_Index = '.echo test\n.';

$result = mysql_query($sql);
 while ($vars = mysql_fetch_array($result)){
   echo document.forms[0].available.text='.$vars[0].';;
   echo document.forms[0].units.text='.$vars[0].';;
 }
?
}//end Modify_Item Details

Thanks for any help,

Steve.

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




RE: [PHP] confused newbie on PHP and Javascript.

2002-06-13 Thread Steve Bradwell

Hi thanks for the reply,

I do believe I understand what client side and server side really mean
although I have much to learn, but is there a way to accomplish what I'm
trying to do? Maybe some kind of work around a person has found when doing
this kind of thing? 

Thanks again,

Steve

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 2:26 PM
To: Steve Bradwell; [EMAIL PROTECTED]
Subject: Re: [PHP] confused newbie on PHP and Javascript.


 I am having a problem, mostly concept wise of how, or if I can use client
 side Javascript in a server side php statement.

Do you know what client side and server side really mean??

For the function below...

 function Modify_Item_Details(){

 var test =
 document.forms[0].item.options[document.forms[0].item.selectedIndex].text;

 ?
 $sql = Select i.QTY_ON_HAND, u.UNIT from items i INNER JOIN;
 $sql.=  units u ON i.Unit_Index = u.Unit_Index;
 $sql.=  where i.Item_Index = '.echo test\n.';

 $result = mysql_query($sql);
  while ($vars = mysql_fetch_array($result)){
echo document.forms[0].available.text='.$vars[0].';;
echo document.forms[0].units.text='.$vars[0].';;
  }
 ?
 }//end Modify_Item Details

you do realize that the PHP runs first, on the server, right?. The output is
then sent to the client and the javascript is exectuted. You can't mix the
two. So, when you call that Javascript function, the PHP is already done,
it's not going to execute. Do a view source of your page...

You can send Javascript variables to PHP by submitting a form or creating a
URL to be clicked on. Either way, the page has to be refreshed/submitted in
order for PHP to recieve the variable.

You can send PHP variables to Javascript, too, but the PHP runs first.

? echo scriptvar test = '$test';/script; ?

---John Holmes...


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

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




RE: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Steve Bradwell

  

 (25) - Here's a virtual quarter, call someone who cares.
  
  
Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 15, 2002 5:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Done w/ PHP - VB or C# ?


I know I'll get mauled big-time on this mailing list but I'm thinking
about putting PHP on hold for a while and learning ASP.NET
 
I love PHP and open-source computing but if one wants to get a job in
web development, you'll have a much better time find a job with both PHP
and ASP (among others) skills.
 
I'm going to hop on the ASP bandwagon but I'm not sure if I should
first learn ASP w/ VB or w/ C#
 
Any thoughts on this?  What are the pros and cons of both?
 
Thanks!

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




RE: [PHP] Cool PHP Tricks/Features ?

2002-05-14 Thread Steve Bradwell

HI Girish,
I'm pretty new to php, using for about 8 months now, I haven't heard of
these, can you go into some detail for me?

Thanks,

Steve

-Original Message-
From: Girish Nath [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 9:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Cool PHP Tricks/Features ?


Hi

I've been using PHP for about 2 years now but only just discovered
ob_gzhandler and gzip/compressing http output.
It's something i wish i'd found out about earlier because even though it's a
simple concept the result blew me away :)

Anyway, i just wanted to know of any other cool tricks/features that you
guys are using that others could have overlooked.

Thanks


Girish
--
www.girishnath.co.uk




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

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




RE: [PHP] Formatting Information in header? Gridlines in Excel

2002-05-06 Thread Steve Bradwell

This is intriguing me, are you opening up excel in a browser window or just
printing out html tables?? I am confused.

Thanks,
Steve.

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 06, 2002 9:54 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Formatting Information in header? Gridlines in Excel


[snip]
Are you actually sending an excell file, or just data that you expect excell
to format? If your sending a file, then you have to create the grid lines
there. These are HTTP headers that you are talking about, they wouldn't have
any control over excell data.
[/snip]

Nope, it's not an Excel file. It is a PHP file imitating an Excel file,
calling data from the DB and generating the worksheet on-the-fly. I want the
gridlines to display and was hoping that there was something I could put in
the PHP page to make sure that this happens.  I am delivering HTML table(s)
to Excel for parsing, which it does just fineuh oh...I feel an idea
coming onlet me try adding a border=1 to the table tagthat works!

Thanks for wording it differently, I saw it in a different light and the
answer cam upon me like a Monday morning lightning strike.

Jay Blanchard



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

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




RE: [PHP] Formatting Information in header? Gridlines in Excel

2002-05-06 Thread Steve Bradwell

Wow! I am impressed, thats too cool. And man is that ever going to be
helpful.

Thanks,
Steve

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 06, 2002 10:25 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Formatting Information in header? Gridlines in Excel


[snip]
This is intriguing me, are you opening up excel in a browser window or just
printing out html tables?? I am confused.
[/snip]

I am using PHP to query a database and create an HTML table based on the
information in the database (in this case it it a large crosstab query).
This is set up to open Excel in a broswer window (inline) and display the
data in a worksheet. All normal Excel functions can be performed on the
worksheet without changing the data in the database. These worksheets then
can be saved to the user's local disk. They can always run the original
query again by requesting the worksheet/page again.

Link pointed to php page that will send to browser a
href=test.php/test.xls Stupid IE trick, the .xls file does not 'exist',
but will fake out Excel to open the .php 'page' in a worksheet. Also, make
sure to include header information listed in previous e-mail at the top of
the PHP page.

The steps are;
1. Create a PHP file with the header info
2. Do a PHP request to the database.
3. Use the results to create an HTML table within the PHP
4. Open this table in a spreadsheet

HTH!

Jay Blanchard



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

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




RE: [PHP] PHP editing environment

2002-05-03 Thread Steve Bradwell

I am using Apache php and MySQL at work and at home, at work I have a win98
box and I use Maguma Studio Light for php as an editor, at home I use VIM
for my editor, Maguma is really working for me. What I did was download php,
MySql, and Apache then find a good tutorial, of which there are many, on the
net that deals with all three and how to correctly install them. Once you
figure out the config files, its as easy as pie baby.

Then you can view your test scripts through ie, or hook Maguma up to work
with php and it renders the pages for you right in the editor. And trust me
its easy to do. One more thing, if you haven't already I recommend getting
phpMyAdmin to administer your mysql databases, this combination blows any
purchased product out of the water with ease of use and speed.

-Steve.

-Original Message-
From: Pag [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 03, 2002 7:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP editing environment



Hi, i am new to the list and i am quite impressed with whats going
on over 
here. Anyway, just have a small question.
Have been coding php for a while now but i still havent found a
stable 
(easy and not time consuming) way of working in PHP, i mean, i use 
homesite5 to code and when i want to test the php i upload the scripts and 
test them on the site. This process is a bit time consuming, so i installed 
php on my winXP, but even like that i can only test small things using php 
master editor.
Anyone know how i can make my work more efficient? Like install
MySQL and 
PHP and get everything working normally when i preview the code in internet 
explorer, that would be perfect, is it possible? How do you guys and girls 
work with php, what editors and/or tools you use?
Thanks.

Pag


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

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




RE: [PHP] Re: why is better?

2002-05-02 Thread Steve Bradwell

Hi,

Sorry to bud in on this, but I was thinking about writing my next php app
oop style to learn. Are you saying that It is going to be slower or 
poorer performance?

Thanks alot

-Steve the newbie.

-Original Message-
From: Julio Nobrega Trabalhando [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 6:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: why is better?


  Faster, and better interaction with the engine that runs php (and
therefore other parts of the system).
--

Julio Nobrega.

Franky [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Why is better to write module than class?
 ok is compiled code so is supose to be faster, but that all?

 Frank
 [EMAIL PROTECTED]





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

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




RE: [PHP] Hashes in strings

2002-05-02 Thread Steve Bradwell

Not really sure but str has to be $str, and I usually do print lines like
this
$str = I can NOT use .$hash['vars']. in strings;

the . will concat the strings together.

Hope this helps, 

-Steve


-Original Message-
From: Ferry van Steen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 02, 2002 4:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Hashes in strings


Hey there,

why do these work:
$vars = vars;
$ar[0] = arrays;
$hash['vars'] = hashes;
str = I can use $vars in strings;
str = I can use $ar[0] in string;

while this one doesn't:
str = I can NOT use $hash['vars'] in strings;

Kind regards


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

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




RE: [PHP] PRIMARY KEY vs. INDEX

2002-05-02 Thread Steve Bradwell

I was just doing some reading on indexes when I saw this post and I have a
question about Over Indexing.
I have a MySQL table that stores inventory transactions, in, out etc. I
mainly store
fields that are primary indexes in other tables, Paul DuBois' MySQL book
says that anything used
in a where clause or join clause should be indexed. So it turns out that 7
out of eight fields fit this description,
1 primary key, 4 smallints, and 2 are datetime fields. 

Should I use all these indexes or are they not needed?

Sorry about asking this in a php list but I saw the topic, and there's no
dba where
I work.

Thanks
-Steve.


-Original Message-
From: SP [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 02, 2002 3:11 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] PRIMARY KEY vs. INDEX


Indexes are good but the only thing you have to look out for is not over
using it.  So
don't index all your fields because it will make your database a lot bigger
and add more
time when inserting and updating.

-Original Message-
From: Dan Hardiker [mailto:[EMAIL PROTECTED]]
Sent: May 2, 2002 8:41 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] PRIMARY KEY vs. INDEX


To clarify, an indexed field is *not* inheriently unique. You can have an
indexed field which is not unique, and a unique field which is not indexed
(hence the options being available).

A primary key is both indexed and unique (with the slight adaption of
compound keys)... but this is majorly off topic.

http://www.mysql.com/doc/

- Dan

 Christoph,

 Indexes are built on key fields, so yes. When a field is identified as
 a  key it is indexed.

 To answer your second question, it is the index which maintains the
 uniqueness of a field.

 A book is a really good analogy. If you wanted to look up the
 references to  string, you can do it very quickly in the index. Even
 if you don't come  close to the s section, you immediately know
 whether to look next to the  right or to the left. If you push the
 issue, and act extremely dumb (like a  computer), you'll find the page
 containing string within 7 hits; once  you're on that page it's a
 short read to find the term. That's what makes  searching on indexed
 fields so fast.

 To find the term in the book requires you to start reading on page 1
 and to  read text until you find the term. Which why searches which do
 not take  advantage of key fields are so slow.

 Indexes are your friend, they don't slow down the addition of records
 that  much, and make retrieval of records extremely fast.

 Regards - Miles Thompson



 At 02:13 PM 5/2/2002 +0200, Christoph Starkmann wrote:
Hi there!

I guess I got a very easy question for the pros here...
I've been searching the documentaion of mySQL, but didn't
find the answer (even though I'm sure it's out there
somewhere :))...

Is a primary key in mySQL automatically indexed? And is a
unique field indexed automatically ?(I don't think and
don't hope so, but one never knows)

Thanx,

Kiko

--
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
--

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


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


--
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



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



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

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




RE: [PHP] convert access to JAVA PHP mysql Xml Soap

2002-05-01 Thread Steve Bradwell

I agree John, what kind of intelligent person would advertise a M$ job on 
a PHP list, be gone company man.

-Steve.

-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 11:45 AM
To: [EMAIL PROTECTED]
Cc: 'PHP General'; [EMAIL PROTECTED]
Subject: RE: [PHP] convert access to JAVA PHP mysql Xml Soap


Gee, why didn't you copy all of the lists on your wonderful reply to my
message? I'm not trying to cock up life, whatever that is. I'm just
trying to stop people like you from wasting everyone's time. Don't send
messages to a PHP list about an ASP programmer or learn how to write a
decent job description that accurately describes what you're looking
for. I'm sure other people agree with me. I should Cc: your message and
response to all of the PHP lists you spammed to so everyone can know
what kind of company you are running. 

v/r

John Holmes

 -Original Message-
 From: Jacky Kenna [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 01, 2002 5:17 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] convert access to JAVA PHP mysql Xml Soap
 
 Wonderful that you have the time to reply.  Must be sitting on your
arse
 doing fuck all. At least we are doing something. Why do we all have to
put
 up with slobs like you who only have time to cock up life.  Surely you
 should be out marching it's May day.
 
 -Original Message-
 From: John Holmes [mailto:[EMAIL PROTECTED]]
 Sent: 01 May 2002 16:12
 To: [EMAIL PROTECTED]; 'Jacky Kenna'
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] convert access to JAVA PHP mysql Xml Soap
 
 
 I don't know what kind of company you run, but I consider this SPAM.
You
 sent this crap out to a bunch of PHP lists and you're looking for an
ASP
 programmer. Who cares if there are people on here that know ASP,
that's
 not why they are on this list. If they are looking for ASP jobs,
they'll
 subscribe to an ASP list. I wouldn't have anything to do with a
company
 that does this. Keep you SPAM to yourself next time and stop wasting
my
 time.
 
 v/r
 
 John Holmes
 
  -Original Message-
  From: Jacky Kenna [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, May 01, 2002 4:17 AM
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-
  [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
 php-
  [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-gtk-
  [EMAIL PROTECTED]; [EMAIL PROTECTED];
 [EMAIL PROTECTED];
  [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-
  [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
  Subject: [PHP] convert access to JAVA PHP mysql Xml Soap
 
 
  Hi  We are a publishing company based in London. We have developed a
  multi-user
  MS Access contact management and bookkeeping database system which
we
 want
  to adapt / re-write such that it can be used over the web ( ASP)
using
  Internet
  Explorer (or similar) from any location, as our clients would like
to
 use
  it.
 
  We are therefore looking for someone to develope or who will head a
 team
  of
  developers and
  co-ordinate this project. If you are interested in working with us
on
  this,
  please e-mail [EMAIL PROTECTED] with a brief outline of your
  knowledge
  and experience of programming languages and I will get back to you
as
 soon
  as possible.
 
  Jacky Kenna
  Managing Director, PDA
  0207 384 1985
  [EMAIL PROTECTED]
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



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

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




RE: [PHP] Help need (Urgent)

2002-05-01 Thread Steve Bradwell

How are you printing the vars??

 like this?
  echo $des;
-Steve

-Original Message-
From: Luiz Rafael Culik Guimaraes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 12:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Help need (Urgent)


Dear Friends
I have an form that get the user info , and i need to send an email to the
user .
which is attached
The problem , when I post the data, php dont see se variables.

Can someone help
Even if i try
http://localhost/meu.php?[EMAIL PROTECTED]to=rafapass=ppuser=ruki the
variables dont have any values

--
[]´s

Luiz Rafael Culik
http://sites.uol.com.br/culikr






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

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




RE: [PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Steve Bradwell

Try this,

  $query = DELETE FROM [users] WHERE [user] = '$user';
  $result = mssql_query($query) or die(Unable to delete user);
  if ($result)
 //delete worked.
  else
 //delete failed.

-Original Message-
From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 12:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Checking to see if a DELETE was successful from MSSQL


Can anyone tell me the best way to check that a DELETE query was successful.
I have tried using mssql_num_rows() and mssql_rows_affected() but it is
always telling me that the DELETE was successful, even when it shouldn't
have been.  Here is the code that I am trying to work with right now.

?
function delete_user($dbname, $user) {
  //connecting to db and getting table
  mssql_select_db($dbname) or die(Table unavailable);

  //deleting user from user table
  $query = DELETE FROM [users] WHERE [user] = '$user';
  $result = mssql_query($query) or die(Unable to delete user);
  if(mssql_num_rows($result)  0) echo User successfully deleted.br\n;
  else echo User does not existbr\n;
}
?

*Running PHP 4.1.2 on Windows NT 4.0 with MS SQL Server 2000

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.




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

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




RE: [PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Steve Bradwell

I agree, try using a select after the delete.

-Steve.

-Original Message-
From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 1:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Checking to see if a DELETE was successful from MSSQL


I tried that already, it always returns true.  The reason is because it will
always return true since it is only deleting if the user exists.  This means
that the query will run and successfully complete.  But if the user does not
exist it still runs and completes successfully, but the user was not there.
So how do I detect that situation.

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.

Steve Bradwell [EMAIL PROTECTED] wrote:
 Try this,

   $query = DELETE FROM [users] WHERE [user] = '$user';
   $result = mssql_query($query) or die(Unable to delete user);
   if ($result)
  //delete worked.
   else
  //delete failed.

Original Message
 Can anyone tell me the best way to check that a DELETE query was
successful.
 I have tried using mssql_num_rows() and mssql_rows_affected() but it is
 always telling me that the DELETE was successful, even when it shouldn't
 have been.  Here is the code that I am trying to work with right now.

 ?
 function delete_user($dbname, $user) {
   //connecting to db and getting table
   mssql_select_db($dbname) or die(Table unavailable);

   //deleting user from user table
   $query = DELETE FROM [users] WHERE [user] = '$user';
   $result = mssql_query($query) or die(Unable to delete user);
   if(mssql_num_rows($result)  0) echo User successfully deleted.br\n;
   else echo User does not existbr\n;
 }
 ?

 *Running PHP 4.1.2 on Windows NT 4.0 with MS SQL Server 2000



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

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




RE: [PHP] Variables not set

2002-04-26 Thread Steve Bradwell

I'm pretty new to php but I think your this() function you need to say:

$h = $$this;
$i = $$that;

which means the value of the var.

Sorry if I'm wrong.
-Steve

-Original Message-
From: Liam Gibbs [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 26, 2002 3:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Variables not set


I have a problem with my variables not being set. I
have a file I use for constants and functions,
structured like so:

$this = this;
$that = that;
.
.
.
function this() {
$h = $this;
$i = $that;
}

function that() {
}

Now, when I run this(), $this isn't set (even though
it's above it in the same file). I can pretty much
guess (when running a function, it won't parse through
the whole file, just skips to that function), but I
was wondering if there is another solution. I'd hate
to separate the variable settings and the functions,
but will if I have to.

__
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

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

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




RE: [PHP] Variables not set

2002-04-26 Thread Steve Bradwell

Ha, Sorry wrong instance here, ya global or pass the vars to the function.

-Original Message-
From: Steve Bradwell [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 26, 2002 3:13 PM
To: 'Liam Gibbs'; [EMAIL PROTECTED]
Subject: RE: [PHP] Variables not set


I'm pretty new to php but I think your this() function you need to say:

$h = $$this;
$i = $$that;

which means the value of the var.

Sorry if I'm wrong.
-Steve

-Original Message-
From: Liam Gibbs [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 26, 2002 3:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Variables not set


I have a problem with my variables not being set. I
have a file I use for constants and functions,
structured like so:

$this = this;
$that = that;
.
.
.
function this() {
$h = $this;
$i = $that;
}

function that() {
}

Now, when I run this(), $this isn't set (even though
it's above it in the same file). I can pretty much
guess (when running a function, it won't parse through
the whole file, just skips to that function), but I
was wondering if there is another solution. I'd hate
to separate the variable settings and the functions,
but will if I have to.

__
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

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

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

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




RE: [PHP] Newbie Book Database Question

2002-04-25 Thread Steve Bradwell

Professional PHP Programming from WROX publishing is a good book too.
I use php and MySQL.

-Steve.

-Original Message-
From: Chris Montgomery [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 9:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie Book  Database Question


Howdy,

I have been developing with ColdFusion for nearly five years and want to
learn PHP. For someone who has never done anything with PHP before, what
*one* book would you recommend as a good primer to get started learning PHP?

Also, do most PHPers use MySQL as your database when building dynamic web
sites, or do you prefer alternative databases like Postgres? From what I
have seen from afar, MySQL seems to be the dominant one, but I have read
that Postgres is more robust.

Thanks in advance and cheers from San Antonio,

Chris Montgomery[EMAIL PROTECTED]

Airtight Web Services   http://www.airtightweb.com
Web Development, Web Project Management, Software Sales
210-490-3249/888-745-7603


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

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




RE: [PHP] replacing first occurence

2002-04-24 Thread Steve Bradwell

http://www.php.net/manual/en/function.ereg-replace.php

-Steve.

-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 12:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] replacing first occurence


What function can I use to replace just the first occurence of a , in a
string?
Thank you



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

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




RE: [PHP] PHP editor for windows

2002-04-22 Thread Steve Bradwell

I like VIM. at www.vim.org its got great color for a multitude of languages
and its a powerful editor too.

-Steve.

-Original Message-
From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 5:40 PM
To: PHP
Subject: RE: [PHP] PHP editor for windows


www.editplus.com

-Original Message-
From: Scott St. John [mailto:[EMAIL PROTECTED]]
Sent: 22 April 2002 06:26
To: .ben
Cc: PHP
Subject: Re: [PHP] PHP editor for windows


Macromedia/Allaire Home Site 5.0 has PHP color coding, not auto-complete, 
but you can customize it for auto-complete if you want.  You can also 
make it tab 2 instead of 4 :)  It's been my editor since the free version 
1.0 and it's a work horse.  And Home Site has Ultra Dev/Dream Weaver 
integration.

PS-- This is MY opinion and NOT intended to start any Holy Wars.

-Scott




On Mon, 22 Apr 2002, .ben wrote:

 Other than notepad, interdev, ultraedit, etc (which i currently use for
 editing), does anyone know of a good editor for PHP for Windows, ideally
 with syntax colouring, etc?
 
 Cheers,
 
  .ben
 
 
 

-- 



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




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

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




RE: [PHP] format date

2002-04-16 Thread Steve Bradwell

Hey Alex,

I use a short function like this because the date is really just a string
you can pick it apart and re-arrange it.

function Format_Date($Date){
 return $Date =
((substr($Date,6,2)).-.(substr($Date,0,2)).-.(substr($Date,3,2)));
}

Steve.
-Original Message-
From: Alex [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 16, 2002 1:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] format date


I just started with php and am  trying to display a query result for a date
field as mm/dd/ instead of  mysql's  -mm-dd. I looked through some
books and found the use of DATE_FORMAT to covert the dates. Is there any
other way to format the date?

Thanks

My script looks like this:

  $month_1 = ($date_month_1);
  $day_1 = ($date_day_1);
  $year_1 = ($date_year_1);
  $month_2 = ($date_month_2);
  $day_2 = ($date_day_2);
  $year_2 = ($date_year_2);

  $query = SELECT * FROM tablename where date = '$year_1-month_1-$day_1-'
AND
date = '$year_2-$month_2-$day_2';

  $result = mysql_query($query);

  $num_results = mysql_num_rows($result);


echo pNumber of records found: .$num_results./p;

  for ($i=0; $i $num_results; $i++)
  {
 $row = mysql_fetch_array($result);

 echo pstrong.($i+1).. ID: ;
 echo ($row[id]);
 echo /strongbrFirst name: ;
 echo ($row[fname]);
 echo brLast name: ;
 echo ($row[lname]);
 echo brDate: ;
 echo ($row[date]);



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

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




[PHP] launching an exe

2002-04-15 Thread Steve Bradwell

Hi everybody,

Is there a php function I should use to launch an executable program from a
users hard drive instead of just creating a link to it??

Thanks alot,
Steve.


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




[PHP] newbie running an exe

2002-04-15 Thread Steve Bradwell

Hi everyone,

My appologies if this is a repost, it's a monday morning. I wan't to know if
there is a function in php that I can use to launch an mdb or exe from the
users hard drive, I would like to avoid a temp copy being created in
windows/iexplorer temp dir because I am getting 2 copies opening when I
launch an app from an href.

Thanks alot,
Steve
Junior Software Engineer
CompexWaterloo.

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




[PHP] 2 newbie questions ;)

2002-04-12 Thread Steve Bradwell

Hi there,

I am populating form elements (type=text) with values from a db, but if
the string has a space in it, it cuts the string off at the space. eg. $var
= the cat in the hat  but all you see in the text box is the. is there a
function I should be adding to my echo line?

Also I have an anchor tag that is a link to open an Access db. For some
reason it opens 2 copies instead of one. i have tried the following: a
href=..\foldername\microsoft_sucks.mde target=_blankLaunch App/a
and
  a href=file://server/path/ms_sucks.mde
target=_blankLaunch App/a
but it seems to want to open two copies anyhow,
anyone seen this before?

Thanks,
Steve.
   

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