[PHP-DB] PHP - FreeTDS - UnixODBC - MS-SQL Am I missing something....

2008-06-12 Thread Bill Sappington

Hey there folks...

OK, so I am getting to the point where I am not sure where to look...

It would seem that the combination of PHP & ODBC are just not happy.

This is running on SLES 10 SP1, php 5.1.2 Zend Eng 2.1.0

FreeTDS is latest stable, UNIXOdbc Latest Stable

I can connect just fine ie:

$conn = odbc_connect(SrvIP,'sa','saPWD');

Changing databases is not problem ie:

odbc_exec($conn,'use different_DB');

I can make calls to things like odbc_tables() and iterate through the
table names. and I can do this from either the server command line or
via a web page, all of this is fine.

I can connect to the remove database server with both:

 tsql  [serverip], [username],[password]

isql [DSN], [username],[password]

I can execute queries, I can create tables, drop tables, insert rows,
all works just fine.

The problem hits when I do something as simple as:

$conn = odbc_connect(SrvIP,'sa','saPWD');

$query = 'select count(*) from sysobjects' ;

$result = odbc_exec($conn,$query);

I try this and it is game over.  Nothing it all just hangs.  I have
tried reviewing the sql.log file and it just simply stops logging after
the connect statement.

This is the result, from either the command line ie:php5 sqltest.php or
pulling it from a web page ie: http://server/sqltest.php

I would be very appreciative if someone could provide me with a clue as
to where to start looking.  I have reviewed all the setting for PHP,
Apache, ODBC, FreeTDS and I cannot find something wrong, but obviously,
I am missing something here.

Thanks in Advance,

- Bill

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



[PHP-DB] RE: [PHP-WIN] php with IIS

2007-03-08 Thread Bill Bolte
Absolutely. You just need to download the windows version and run the
installer. Runs fine. You can even run PHP and ASP scripts side-by-side
if needed. 

-Original Message-
From: Harpreet [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 08, 2007 9:57 AM
To: php-windows@lists.php.net; php-db@lists.php.net
Subject: [PHP-WIN] php with IIS


Is there a way to run our PHP pages through Microsoft's IIS?

Regards,
Harpreet Kaur


--
PHP Windows 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] running program after insert w/MySQL 4.1

2006-07-07 Thread bill
Access is the backend for a proprietary front end.  I just checked with 
the company and they can't understand why anybody would want to change 
the program(!). In any case, they won't allow it.


So, I'm stuck with the ODBC call from the Win computer sending data to 
the mysql db on the linux computer.


How can I get a web page called after the ODBC call?  Am I stuck with a 
cron job on the linux box?


Bastien Koert wrote:

You should be able to open a web page from access (might need to write 
a module) and call a page that would then run your script


Bastien



From: bill <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] running program after insert w/MySQL 4.1
Date: Fri, 07 Jul 2006 15:11:07 -0400

I have an Access database connecting via ODBC to a local MySQL 
machine and doing inserts.  It does these inserts throughout the day.


After each insert, I need a PHP program run.

Alas, MySQL 4.1 doesn't do triggers, etc., and upgrading to 5.x looks 
non-trivial.


What else can I do?  Is there any way to trigger something via the 
ODBC connection?


A cron job?

I'm open to suggestions.

kind regards,

bill

--
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



[PHP-DB] running program after insert w/MySQL 4.1

2006-07-07 Thread bill
I have an Access database connecting via ODBC to a local MySQL machine 
and doing inserts.  It does these inserts throughout the day.


After each insert, I need a PHP program run.

Alas, MySQL 4.1 doesn't do triggers, etc., and upgrading to 5.x looks 
non-trivial.


What else can I do?  Is there any way to trigger something via the ODBC 
connection?


A cron job?

I'm open to suggestions.

kind regards,

bill

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



[PHP-DB] mysql went away

2004-05-12 Thread Bill Green
HI. I've been using mySQL 4.0.13, php4.3.4, and phpMyAdmin2.5.5 on Mac 
OS 10.3.3 as a learning/testing/development environment for a couple of 
months now - no problems, works great.

I've created more than a few mySQL databases and tables, but yesterday 
I created a database, a table, and LOAD DATA from within phpMyAdmin. 
Successfully. I looked at the data and all was fine. Logged out and 
went away for a while. Came back and phpMyAdmin would not show me my 
databases in the left frame, and I could not launch a query window. I 
could see runtime information, system vars, processes, and even 
privileges.

I tried logging in to mySQL through the terminal, and I can run simple 
commands and connect OK, but any commands to show databases or tables 
will hang the terminal. Through the command line client I can run 
simple commands, but no commands to view or affect databases or tables.

I can run php scripts - connect to databases, retrieve and even 
insert/update data, but I cannot view databases or tables.

Does anyone have a clue about what the problems may be or where I 
should start?

---
Bill Green
20 Meadowview Drive
Asheville, NC 28804
--
[EMAIL PROTECTED]
http://www.billgreen.org
828.252.1492
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] sql to find one year in datetime MySQL column

2003-07-16 Thread bill
How can I find all the records for a single year from a db that has a datetime
column (in MySQL)?

This seems to work:

SELECT * from mytable
WHERE tstamp < '2003-01-01 00:00:00'
AND tstamp > '2002-01-01 00:00:00'

But this doesn't:
SELECT * from mytable
WHERE tstamp LIKE '2002%'

Is there a simpler way than the first one?

kind regards,

bill hollett


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



[PHP-DB] windows explorer

2003-07-14 Thread gates bill
Hello ,
i want to make an windows explorer like application in Php where on the left hand side 
i have the folders with + or - sign and if i click on + sign it should show me the 
sub-folders 
in that folder just like we can see in windows explorer, and when i click on - then it 
should fold back and only show the main folders.
Also if someone click on the folder then he can see all the items in that folder on 
the right hand sign frame.
hope u can provide with some input on how to do the same or where to get codes for the 
same .
thanks in advance.


-
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.

[PHP-DB] PHP help

2003-06-29 Thread Bill Pilgrim

My System:  
Windows 98
Apache 1.3.27
PHP 4
mysql

Hello all, I am a PHP beginner and was wondering if I could get some help from some of 
the more experienced on this list.  I have been trying to use an html form (with 
textboxes, radio buttons, and textareas) to input data into a mysql database.  I am 
able to connect fully with the database and am able to create tables in it, but when I 
try to input information into the tables nothing happens. ever...  I don't really know 
what to do from here, but I assume that a configuration is not set properly between 
mysql, apache, windows, or php.  I really don't know what it could be.  My code is 
here and I have tried to simplify the form in order to get it working, so here is my 
barebones code that hopefully has some errors:
HTML:


Simplify



Login: 





PHP file called "addform.php":



Login is the name of the table on the database named test.

I stopped using a password because it wouldn't let anything work even table creation 
when I tried to use a password.  Any help that anyone could give would be greatly 
appreciated; there is probably some grievious error in this script.  Thanks, Chris




-
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

[PHP-DB] sorting results in PHP

2003-03-11 Thread bill
I have a query that returns results including the fields Year, Month, and Day
that I want to sort by date.

Because of the nature of the query (it includes a GROUP BY statement), I cannot
sort it in the query.

How can I sort the results?

I tried to use asort() while designating the field but that didn't work.

while ($crow=mysql_fetch_array($cresult)) {
  $therow[]=$crow;
}
asort($therow["Year"]);
reset($therow);
asort($therow["Month"]);
reset($therow);
asort($therow["Day"]);
reset($therow);

ideas?

kind regards,

bill


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



Re: [PHP-DB] Textarea, File Upload field setting values

2003-01-04 Thread Bill Lovett
For the textarea, print the value between the tags-- there is no value
attribute:



You cannot do this with file inputs.

-bill



Rajesh Fowkar wrote:

Hi,

I can write a code like :



Thus I can set the value of $txtfield1 and it is reflected in the above
textbox.

How can such thing be done with TextArea and File upload ?





The above stuff is not working. Is it possible to accomplish the above
stuff ? I need this since I am calling the same form on submit for
validation and hence will need the values of the above also to remain
intact in case of error in any other fields.

Thanks in advance.

Peace

--
Rajesh *  [EMAIL PROTECTED]  *  http://www.symonds.net/~rajesh/
Powered By : Debian GNU/Linux 3.0 (Woody) - [Kernel 2.4.18(ext3),Mutt 1.5.1i]
It's not the valleys in life I dread so much as the dips.
		-- Garfield





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




Re: [PHP-DB] Using ifelse to go to another page

2003-01-04 Thread Bill Lovett
Change the second ifelse-- either get rid of it, or put it at the end.

Right now your logic is like this:


if (a equals b) {
 ...
} elseif (a does not equal b) {
...
} elseif (c equals d)
etc


One of the first two conditions will always match, so the rest of the 
statement is skipped.

-bill

Alex Francis wrote:
I have dropdown lists on one page which were working fine. However I need to
make a slight alteration and add another 2 ifelse statements to go to
another page instead of carrying out the $SQL statement.

I have added the last 2 ifelse statements but I still get the SELECT
statement working. Can someone help please.

";
}
elseif ($level=="5-14 Curriculum")
{
"";
}

$retid = mysql_db_query($dbname, $SQL, $link);
if (!$retid) { echo( mysql_error()); }
else {
// the rest creates a table with the information from the SELECT statement.








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




[PHP-DB] Database Connections

2002-11-29 Thread Bill Arbuckle, Jr.
I have a general question concerning databases in php.  More specifically,
what is the general consensus on maintaining a connection.  Some of this is
more than likely my ignorance.

My connection stuff goes something like this ...


$db = mysql_connect("localhost", "stuff", "pw") or die("Could Not Connect");
mysql_select_db("stuff",$db) or die("Could Not Select Database");

<<< Other Code Here >>>

mysql_free_result($result);
mysql_close($db);


It seems very inefficient to open and close a database with each different
page or call to that database.  My question is ... Is there a better way
and, if so, what is it?  I guess I do not quite understand just how long a
connection is maintained.  I hate to write code that doesn't clean up after
itself.  Any suggestions are appreciate.  TIA

Bill


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




[PHP-DB] mysql problem

2002-11-28 Thread Bill Arbuckle, Jr.
Hello all!  I am new to php and I am trying to update a mySQL table using
php v4.2.3 for Windows.  I am using the command:

mysql_query("insert into tblquotehits
(qoption,referer,browser,remoteaddr,dt) values
($quotetype,$referer,$browser,$remoteaddress,$currentdtstring)",$db);

I have read the documentation and found some notes on the topic but none
seemed to solve my problem.  I have tried other variations of the command
such as inserting a semicolon at the end of the insert statement before the
closing double quotes.  All variables are defined and all columns are
actually columns in the table ... I have checked all of this.  I have also
returned the result to a variable and echoed it to the screen ... the result
printed is "Resource id #2".

This is driving me crazy as I know it must be something quite simple that I
am overlooking.  Any help is greatly appreciated!  TIA

Bill


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




[PHP-DB] Problems with ODBC connectivity

2002-10-29 Thread Bill Hudspeth
I have developed a PHP application that accesses a Microsoft Access database
through ODBC. The application works well using PHP version 4.1. I have
recently installed the newest version of PHP (4.2.3) on another machine
running NT4, and IIS 4.
Again, I am using an ODBC connection, and have given this connection the
same name, login, and password as is present in my PHP files. While the PHP
module is running fine, I cannot retrieve records from the database,
probably indicating a problem with my connectivity to the ODBC. Again, I
have made the same settings in the new ODBC entry as is present on the
development machine. Could there be a version problem with the PHP module?
Any other suggestions would be greatly appreciated.

Thanks, Bill



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




[PHP-DB] Multiple outer joins submitted via ODBC driver to MS Access??

2002-08-29 Thread Bill Hudspeth

I am using PHP 4.1 with the ODBC driver on MS Windows 2000, running IIS. I
am trying to submit a SQL statement with multiple outer joins to a MS Access
database. Does anyone know the syntax for creating such MULTIPLE outer
joins? As it is, my current SQL statement drops rows for which certain
columns have NULL values. Thanks, Bill.
My current, inner join syntax is:

$class_query = "SELECT sample.Sample, type.type_name, chon_class.class_name,
chon_group.groupname, brecciation.brec_type
FROM sample,type,chon_class,chon_group,brecciation

WHERE sample.type = type.type
AND sample.chon_class = chon_class.chon_class
AND sample.chon_group = chon_group.chon_group
AND sample.brecciation = brecciation.brecciation

AND sample.type=$met_type
AND chon_class.class_name LIKE '%$chondritic_class%'

ORDER BY chon_group.groupname,brecciation.brec_type";




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




Re: [PHP-DB] MySQL timestamp field in different time zone

2002-06-13 Thread bill

No, it is similar to your situation.  Server is in another time zone from the user.  I 
want the timestamp to be relative to the user, not the server.

Maybe do something in grenwich time, then interpret all queries from the db . . . ?

kind regards,

bill

Ryan Jameson wrote:

> BTW... are you saying that you plan to move the MySQL server around to different 
>time zones? Why would you do that?
>
> -Original Message-
> From: Ryan Jameson (USA)
> Sent: Thursday, June 13, 2002 9:44 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] MySQL timestamp field in different time zone
>
> I had a similar issue where I wanted timestamps to be relative to the user. I didn't 
>find any better way then to create some profile data that contained their timezone 
>and allow them to save that data. Then anytime I displayed a timestamp I added the 
>timezone shift to the stamp. It would be nice if the browser sent timezone 
>information in the header, but as far as I know it does not.
>
> <>< Ryan
>
> -Original Message-
> From: bill [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 8:55 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] MySQL timestamp field in different time zone
>
> How do I get a MySQL timestamp field to update itself when the server is
> in a different time zone, i.e., I want it to have the date for my time
> zone.
>
> The field updates itself automatically, of course, without being
> referenced in the SQL query.  I'd like to avoid having to change every
> query to include tweaking the field for the different time zone.
>
> kind regards,
>
> bill hollett
>
> --
> 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


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




[PHP-DB] MySQL timestamp field in different time zone

2002-06-13 Thread bill

How do I get a MySQL timestamp field to update itself when the server is
in a different time zone, i.e., I want it to have the date for my time
zone.

The field updates itself automatically, of course, without being
referenced in the SQL query.  I'd like to avoid having to change every
query to include tweaking the field for the different time zone.

kind regards,

bill hollett


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




[PHP-DB] Connecting to MS Access

2002-06-12 Thread Bill Hudspeth

I am having problems connecting to an Access database. I am using Windows
2000, IIS 4, Access 2000, and PHP 4.2.1. I have created a system DSN using
the Access (.mdb) driver, and have a username and password. What's going
on?? Thanks, Bill



The code I have used is as follows:













The error message I get is:



Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver]General error
Not enough information to connect to this DSN with SQLConnect. Use
SQLDriverConnect., SQL state S1000 in SQLConnect in
C:\inetpub\wwwroot\PHP\data_tap.php on line 14

Warning: odbc_do(): supplied argument is not a valid ODBC-Link resource in
C:\inetpub\wwwroot\PHP\data_tap.php on line 20

Warning: odbc_result_all(): supplied argument is not a valid ODBC result
resource in C:\inetpub\wwwroot\PHP\data_tap.php on line 23

Warning: odbc_close(): supplied argument is not a valid ODBC-Link resource
in C:\inetpub\wwwroot\PHP\data_tap.php on line 26








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




[PHP-DB] Having trouble understanding how to manage arrays

2002-06-10 Thread Bill Fleury

Hi all.  I am very new to this, and have been reading my way through php, but have 
come accross a stumbling block that I just don't seem able to get past, although I'm 
sure it's something simple.

I have a very basic mysql database set up, that contains a table with 4 fields- type, 
manname, manlink, and recordno

What I need to do is pull all records from the database, and provide a list on a page 
with links to the url's stored in manlink with the lable manname.  So far, I've come 
up with the script at the end of this message.  This script works beautifully for me- 
for the first record.  Could anyone point out why it won't go on to any other records?

Thanks, 

Newbie Bill


 $idl) {
break;
}


$query = "SELECT type, manname, manlink FROM man_links WHERE recordno=$id";
$result = mysql_query($query) or die("Query failed");

extract(mysql_fetch_array($result));

/* Printing results in HTML */
print "\n";
print "$manname";
print "\n";

}
/* Free resultset */
mysql_free_result($result);

/* Closing connection */
mysql_close($link);
?>




[PHP-DB] autoincrement start with higher number

2002-05-10 Thread bill

Is it possible to have an autoincrement field start with a number, so
the first record would be, let's say, 1000 instead of 1?  The next would
be 1001 instead of 2, etc.

kind regards,

bill hollett


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




Re: [PHP-DB] help with preg_replace for http://

2002-03-29 Thread Bill Morrow

On Fri, Mar 29, 2002 at 11:46:24AM -0800, Kevin Won wrote:
> I'm writing a knowledgebase (basically a content management system) application 
>where people are adding text via web forms then viewing this data on the web. 
>standard bread-and-butter kind of stuff.
> 
> of course people want to put in their hyperlinks in the page w/o having to do any 
>sort of html coding. I'm having a hard time getting my regular expression to work 
>correctly to match for anything that starts with http:// and ends with a space 
>character, extracting this as a $string, then formatting the hyperlink as href="$string">$string on the knowledgebase viewing scripts.
> 
> The one I've written matches and replaces only the first instance of http://  in the 
>string. (which solves problems as long as there is only one hyperlink in the page ;-)
> 

Have you considered just using a wiki?

E.g. www.usemod.com, or http://phpwiki.sourceforge.net/


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




Re: [PHP-DB] delete statement question

2002-03-25 Thread Bill Morrow

On Mon, Mar 25, 2002 at 02:42:08PM -0800, Andr?s Felipe Hern?ndez wrote:
> Hi, I hope you can help me with this:
> 
> I have these 3 tables.
> 
> exam (
> exam_id
> )
> 
> questions (
> question_id
> exam_id
> )
> 
> answers (
> answer_id
> question_id
> )
> 
> I am wondering if i can delete all the rows for answers linked to a given
> exam using only one delete statement.
> 
> Thanks in advance,
> 
> andres
> 

delete answers 
where question_id in (select question_id from questions where exam_id=X)

I assume there isn't a one-to-one relationship between questions and
answers? If there is, your database is overnormalized.

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




Re: [PHP-DB] Re: Again Select then update

2002-03-24 Thread Bill Morrow

On Sat, Mar 23, 2002 at 11:46:36PM -0800, Jen Downey wrote:
> Hi all again!
> 
> As Bill Morrow stated (in a private e-mail) I needed to use SET name =
> \"$update\""; instead of SET name = $update";
> It has stopped giving the error but it isn't updating the table. Am I doing
> something wrong?
> line 4 shows print("your name is $name");  The user name is printed to the
> browser but it simply will not update the table.
> 
> $query = "SELECT name FROM users WHERE uid={$session["uid"]}";
> $ret = mysql_query($query);
> while(list($name) = mysql_fetch_row($ret))
> print ("your name is $name");
> 
> $update = "$name";
> 
> $query_update["name"] = "UPDATE my_items SET name = $update";
> $result = mysql_query($query_update["name"])or die("Error: ".mysql_error());
> 

Is this your latest code? You still don't have quotes around $update, if so.

Nothing returned in the .mysql_error()?

Can you run the query by hand?

Bill

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




Re: [PHP-DB] Re: Dynamic Drop Down Box

2002-03-06 Thread Bill Morrow

I haven't actually tried this, but if you use frames, could you submit
from the first dropdown and refresh the second if they are in seperate frames?

Not that I'd like to support that code.

On Wed, Mar 06, 2002 at 10:14:59AM -0800, fls wrote:
> I've got a dynamic dropdown on http://www.northjerseydirectories.com
> I generate the js using php and a MySQL database.  The dropdown does what
> you're looking for.  Since the dropdown is client side you either need to
> go with javascript, an applet, or have the person submit a form that loads
> the second box which is pretty clumsy.
> Fred Steinkopf
> 
> On Wed, 6 Mar 2002, Aron Pilhofer wrote:
> 
> > So, if the user selects "mercedes", then the next box is "500Sl, 300Sc" and
> > so forth. If they select ford, then the second box has completely different
> > values?
> >
> > You'll either have to reload the page after the first select, or use
> > javascript or some other kind of client script. I don't think there is a way
> > to do it with PHP, but maybe someone else has an idea to help you. I hope
> > they do, because I need to do the same sort of thing, and I am trying to
> > avoid js at all costs.
> >
> >
> >
> > "Randy Rankin" <[EMAIL PROTECTED]> wrote in message
> > F3BF649E168BD411A1B700010271F38BB4BD20@SBMAIL">news:F3BF649E168BD411A1B700010271F38BB4BD20@SBMAIL...
> > > Does anyone know how I might populate a drop down box based on the users
> > > selection from a previous drop down box? For example, if I have a table
> > > called 'autos' with 2 fields, 'make' and 'model'. I select distinct 'make'
> > > and populate the first drop down box. Based on the user selection, the 2nd
> > > drop down box would be populated with the distinct 'make' for that model
> > > (ie; if the user selects Ford in the first drop down, the 2nd drop down
> > > would be populated with Explorer, Expedition, Ranger, etc.).
> > >
> > > Thanks,
> > >
> > > Randy Rankin
> > >
> >
> >
> >
> > --
> > 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
> 

-- 

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




[PHP-DB] Re: RC4 encryption with PHP

2002-03-06 Thread bill

Might be late, but here's what I have working.

"Troy A. Delagardelle" wrote:

> I am trying to encrypt a credit card number using rc4 and php and then dump
> it into a mySql database.  Does anyone have any sample code that allows me
> to do this??
>
> I found the Class.RC4Crypt algorithm and would like to use that.  When I
> include the class.rc4crypt.php the page dies...
>
> Here is my code...
>
>  // encrypt the credit card number here.
>
> include("class.rc4crypt.php");
>
> $pass = $whatever;
> $data = $cardInfo['number'];
> $case ='de';

$case should be 'en' for encrypting.

> $rc4 = new rc4crypt;
> $encrypt_CC = endecrypt($pass, $data, $case);

Use this:

  $rc4 = new rc4crypt;
  $encrypt_CC=$rc4->endecrypt($pass, $data, "$case");
  $data="encrypted"; // don't leave it in memory

>
>
> then I will send $encrypt_CC to the DB..
>
> Any help would be greatly appreciated..thx  Troy


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




Re: [PHP-DB] Difficult count statement. Need some sql advice

2002-03-02 Thread Bill Morrow

On Sat, Mar 02, 2002 at 05:36:41PM +0100, Andy wrote:
> Hi there,
> 
> I would like to querry my db for following result
> 
> - Count the number of topics listed in the table fo_topics,
> but only the topics where the belonging forum is not in the archive  mode
> ( this is when table fo_forums field archive is 1)
> 
> I tryed following querry but this is for sure wrong:
> 
> SELECT COUNT(t.*) AS c, f.archive, f.forum_id
> FROM fo_topics t, fo_forums f
> WHERE f.archive != 1
> 
> Can this be that difficult?
> 
> Thanx for any help
> 
> Andy

You need to join the two tables together:

select count(t.*) as c, f.archive, f.forum_id
from fo_topics t, fo_forums f
where t.forum_id = f.forum_id and f.archive != 1

might work. I assume you have a foreign key in fo_topics linking to fo_forums.

Bill

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




Re: [PHP-DB] Question about advanced SQL

2002-02-27 Thread Bill Morrow

select * from tblCd
where cdId not in (select distinct cdId from tblOrders);

On Thu, Feb 28, 2002 at 12:37:49PM +1000, Adam Royle wrote:
> Hi.
> 
> I need some guidance for writing an effective query (instead of processing
> through PHP).
> 
> I lets says I have two tables, tblCDs and tblOrders.
> 
> tblCD
> 
> cdID  |  cdTitle  |  cdArtist
> --
> 1 |  Great Hits   |  Bon Jovi
> 2 |  Forever Young|  The Youngsters
> 3 |  Now and Then |  Beach Boys
> 4 |  Cheesy Name  |  Two Tones
> 
> 
> tblOrders
> 
> orderID   |  cdID_FK  |  ordererID
> --
> 1 |  1|  442
> 2 |  3|  233
> 3 |  1|  233
> 
> 
> Now, I want to select all the records from tblCD where the cdID does not
> appear in any row of tblOrders.cdID_FK
> 
> This means that it selects all the CDs that have not been ordered.
> 
> The results of the query should be
> 
> 
> cdID  |  cdTitle  |  cdArtist
> --
> 2 |  Forever Young|  The Youngsters
> 4 |  Cheesy Name  |  Two Tones
> 
> 
> I know how I can do this in PHP (two queries - put all cdID_FK in an array,
> and on displaying the other query, check if it is in the array, and display
> if not) but there HAS to be an easier way.
> 
> Adam.
> 
> 
> 
> -- 
> 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] mysql_num_rows

2002-01-08 Thread bill

Drop the "$result" from the mysql_num_rows() so it reads:
$num_results=mysql_num_rows();

Depending upon the PHP version, that might do the trick for you.

kind regards,

bill

Mike Ford wrote:

> > -Original Message-
> > From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
> > Sent: 06 January 2002 20:10
> >
> > I am pretty sure that the query is correct. here is the actual query:
> >   $query="select  distinct(nodeid), nodename
> > from books where
> > bookid=$bookid";
> >   $result=mysql_query($query);
> >   $num_results=mysql_num_rows($result);
> >
> 
> >   The funny thing is that if i write the same query without "where
> > bookid=$bookid" then the mysql_num_rows works but with where
> > statement it
> > doesn't.
>
> Have you echoed $result to see what it contains?  My guess is that it contains 
>something unexpected which, when inserted into the query, causes it to fail (or at 
>least return no rows!).  Otherwise, I can see no reason for the addition of the WHERE 
>clause to cause this error.
>
> Cheers!
>
> Mike
>
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: database/form help needed

2002-01-08 Thread bill

Turn your checkboxes into an array



And then parse the array when you POST the form

while (list($key,$val)=each($id)) {
echo "$val"; // this is an id that was checked
} // end while

The virtue of this is you don't have to check for all possible values (id1, id2, id3, 
etc), you'll only end up working with checkboxes that have been checked.

kind regards,

bill

Chris Payne wrote:

> Hi there everyone,
>
> I have a loop which goes through my MySQL database and some PHP code which grabs 
>results 9 at a time, and that works great.  Now, I also have a checkbox called ID for 
>each of the 9 entries and here is my problem.
>
> How can I dynamically assign a unique ID for my checkboxes?  I am getting my 
>checkboxes through a loop, and because of that the ID is called id - for all of my 
>entries, so I can't select multiple as only one entry comes out on the results page.  
>How can I dynamically create checkboxes with a unique id (Such as id1, id2 etc ...) 
>so that I can make multiple selections from my DB?
>
> Thank you all so much - Happy New Year.
>
> Regards
>
> Chris Payne
> www.planetoxygene.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] finding records wiht non-null columns

2002-01-03 Thread bill

Is there a better query than

SELECT *
FROM some_database
WHERE some_column <> ""

I had tried

WHERE some_column <> NULL but that didn't work.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] datetime insert using now()

2001-12-11 Thread bill

Aha.  That seems to work.

thanks,

bill

Charles Lahlou wrote:

> >INSERT INTO thisdb (event) VALUES ((now() + 3600);
>
> try rather VALUES (now() + INTERVAL 3600 SECOND)
>
> charles lahlou
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] datetime insert using now()

2001-12-11 Thread bill

I'm trying to insert information into a datetime field in a MySQL
database with the following:

INSERT INTO thisdb (event) VALUES ((now() + 3600);

But it only works sometimes.  Why sometimes?  What would be a better way
of doing it?




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: JOIN operations

2001-11-10 Thread bill

SELECT table_name.name, table_name.ID_city,
table_city.ID, table_city.city,
FROM table_name, table_city
WHERE table_name.ID_city=table_city.ID

Carlo loiudice wrote:

> Hi,
> I'm preforming a join between 2 Mysql tables in this
> way:
> table_name: ID,name,ID_city
> table_city: ID,city
>
> when I query this:
> "SELECT table_name.name,table_city.ID,table_city.city
> FROM table_name,table_city WHERE
> table_name.ID_city=table_city.ID"
>
> The result is a new table with this fields:
> result_table: name,city.
> There isn't the field table_name.ID_city!!!
>
> Here's the question: I need also this field ID_city
> because there's a function that builds a list box with
> all the cities, and search for a html hidden input
> named ID_city (like the table field) to eventually
> highlight that entry.
>
> can someone help me?
> is there a way to select also the ID_city field
> without break the join mechanism ?
>
> Carlo
>
> __
>
> Abbonati a Yahoo! ADSL con Atlanet!
> Naviga su Internet ad alta velocità, e senza limiti di tempo!
> Per saperne di più vai alla pagina http://adsl.yahoo.it


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] RE: [PHP] Newbie Question

2001-11-08 Thread Bill Adams

Jay Fitzgerald wrote:

> displays fine now -- thanks for that help so far -- but the problem now
> (this may be normal, but I am not sure) is when I connect to the db and
> "select * from jobs;" the db is writing the entries like this:
>
> ===
> mysql> select * from jobs;
> 
>++--+--++-+-+--+--++--+
> | id | position | opendate | salary | appdate |
> duties  | examples | training | skills | benefits |
> 
>++--+--++-+-+--+--++--+
> |  1 | test | test | test   | test| 1
> 2
> 3
>
> 4
> 5
> 6
>
> 7
> 8
> 9 | test | test | test   | test |
> 
>++--+--++-+-+--+--++--+
> ===
>
> is this in fact normal?

Yes.

Since you have \n (and possibly \t, others) in the field, mysql is displaying them on 
the select.

b.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: JOBS in mysql

2001-11-07 Thread Bill Blowitz

would be much easier to answer this question if we knew what
OS is running MYSQL.
I use linux and use cron for most MYSQL stuff.
My pc is NT and for that I use AT.
for win2k Professional, I believe there is a graphical version of AT.
bill

-Original Message-
From: Christian Sage [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 07, 2001 3:23 PM
To: [EMAIL PROTECTED]
Cc: 'Mysql List'; [EMAIL PROTECTED]; Bill Adams
Subject: AW: JOBS in mysql


Hi,

> Harpreet wrote:
>
> > I have run JOBs in sql server and was wondering if we have ne thign
similar
> > in mysql or use PHP to write a script that would automatically run
every 10
> > minutes.
>
> Unix has cron: 'man crontab'
>
> I think Win2k has it included.  Otherwise you will have to get an add-on
> service.

AFAIK there is only 'at' and not 'cron' to be had from the command line.
You could also achieve the desired result using 'at', I guess, but the
action list would become a pain to maintain, and it would also be a
serious abuse of the utility (IMHO, that is).

Your best bet is probably to hunt around for a freeware utility. There's
bound to be something somewhere on the net.

Cheers,

Christian


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: JOBS in mysql

2001-11-07 Thread Bill Adams

Harpreet wrote:

> I have run JOBs in sql server and was wondering if we have ne thign similar
> in mysql or use PHP to write a script that would automatically run every 10
> minutes.

Unix has cron: 'man crontab'

I think Win2k has it included.  Otherwise you will have to get an add-on
service.

b.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] sending bulk emails

2001-11-02 Thread Bill Morrow

You should sort the addressees by domain first too, to give the MTA
a chance to opimize your spam delivery.

On Fri, Nov 02, 2001 at 04:44:06PM +, Shane Wright wrote:
> Hi
> 
> I find that the best way to do it is with a script having a long/unlimited 
> timeout, but limiting it to only a few hundred mails per execution in the SQL 
> '... LIMIT 500'.
> 
> IMO better this way than a short-timeout script - sending one email can 
> sometimes take ages (long DNS lookup, slow connection to the host, etc...)
> 
> Shane
> 
> 
> On Friday 02 November 2001 4:18 pm, Jonathan Hilgeman wrote:
> > Interesting that this should come up. The company I work for needs to send
> > out an e-mail to 95k of their subscribers. Now, this is the first time in 2
> > years, so you can imagine that we'll be getting 94k of bounced e-mail
> > addresses. So I'm writing a script that will handle sending out the e-mails
> > and handling incoming bounced e-mail addresses. In any case, I would think
> > that my PHP script would time out before sending 95k e-mails. I know it has
> > timed out at 30 seconds before, but I can't remember if the faulty script
> > had an endless loop for 30 seconds or if there was any data getting sent or
> > received in that time. Anyone know beforehand whether I will get a timeout
> > with sending these e-mails, and if so, how to work around it?
> >
> > - Jonathan
> >
> > -Original Message-
> > From: Russ Michell [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, November 02, 2001 4:20 AM
> > To: Cami
> > Cc: PHP DB list
> > Subject: Re: [PHP-DB] sending bulk emails
> >
> > > Does anybody know how to send bulk emails using php?
> >
> > Don't do it!!
> >
> > But of you must - I guess you could build an array containing email
> > addresses, names, etc - taken
> > from form input or a database or whatever and then loop the arrays mailing
> > people...
> >
> > $mail = "mail(";
> > for($i=0; $i<$email_array_name;$i++( {
> > $mail .= "$values,";
> > }
> > $mail .= "\"$subject\",\"$body\",\"From: $from\");";
> >
> > Something like that anyway (that's just off the top of my head)
> > Regards.
> >
> > Russ
> >
> > On Fri, 2 Nov 2001 11:26:22 - Cami <[EMAIL PROTECTED]> wrote:
> > > Hi guys,
> > > Does anybody know how to send bulk emails using php?
> > > Thanks,
> > > Cami
> > >
> > > --
> > > PHP Database Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> > #---#
> >
> >   "Believe nothing - consider everything"
> >
> >   Russ Michell
> >   Anglia Polytechnic University Webteam
> >   Room 1C 'The Eastings' East Road, Cambridge
> >
> >   e: [EMAIL PROTECTED]
> >   w: www.apu.ac.uk/webteam
> >
> >   www.theruss.com
> >
> > #---#
> 
> -- 
> Shane
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL: Alphabetizing title results in library format

2001-11-01 Thread Bill Morrow

On Thu, Nov 01, 2001 at 04:43:00AM -0500, Ian Evans wrote:
> Cami wrote:
> 
> > Try this:
> > mysql> select *,(case when title like '%The%' then substring (title, 5, 255)
> > when title like '%A%' then substring (title, 3, 255) when title like '%An%'
> > then substring (title, 4, 255) else title end) as sort_col from titles order
> > by sort_col;
> 
> Argh, that still produces the same syntax error. Our hosting company is 
> using MySQL 3.22.32 if that's any help.
> 
> -- 
> Ian Evans
> Digital Hit Entertainment - News and Information
> http://www.digitalhit.com
> 

I would do this in the php layer.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: looped insert

2001-10-23 Thread bill

Hi Russ,

It's not clear that you're keeping track of which categories are being checked.

You name them category[$names]  but you refer to them as $category[$i] where $i is a 
number.  How will you know what $category[1] refers to?

Other issues: It's also not clear where the value of $email comes from.  Nor is it 
clear if you're trying to obtain one row in the database with all subscriptions or 
whether
you could have multiple lines for multiple subscriptions.

Try this

while (list($key,$val)= each ($HTTP_POST_VARS[category]) ) {

$thisname=$key;  // this is the "name" of the checkbox, as in $category[$name]
$thisval=$val;   // this is the value, which in every case is "yes"

$sql="INSERT INTO $myanet02($thisname) values ($email)";
// this will produce a line in the db for each subscription

// if you want one line for all subscriptions, remvoe the $sql line above and
// uncomment these lines below
// to compound the sql and run the query after the while

// if ($thefields) $thefields .= ", $thisname"; } else { $thefields = "$thisname"; 
}
// if($thevalues) $thevalues .= ",'$email' " } else { $thevalues = "'$email'"; }

$query = mysql_query($sql,$connect) or die(mysql_error());

} // end while

// uncomment following lines for single row entry
// $sql= INSERT INTO $myanet02($thefields) values ($thevalues)";
// echo $sql;
// $query = mysql_query($sql,$connect) or die(mysql_error());

kind regards,

bill hollett

Russ Michell wrote:

> Hi everyone:
>
> I've been fiddling with this all day, and well - if it was working you wouldn't be 
>reading this right now! ;-)
> My script should take the selections made by users and process them via 
>straightforward MySQL inserts:
>
> //Get all table column names, dynamically display them as checkboxes. Use to process 
>subscriptions:
> $fields = mysql_list_fields("$dbName", "myanet_categories", $connect);
> $columns = mysql_num_fields($fields);
> for ($i=0; $i<$columns; $i++) {
> $names = mysql_field_name($fields, $i) . "\n";
> $catselect .= "$names name=\"category[$names]\" value=\"yes\">\n";
> }
>
> //If submit button selected, process those ticked checkbox categories:
> if(isset($submit)) {
> //loop while categories have been ticked
> for($i=0;$i if($HTTP_POST_VARS["category{$i}"] == 'yes') { //Not sure about this 
>bit...
> $sql = "INSERT INTO $myanet02 
>(staffdev,strategies,rules,news,information,policies) 
>VALUES('$email','$email','$email','$email','$email','$email')";
> //$query = mysql_query($sql,$connect) or die(mysql_error());
> echo $sql;
> }
> }
> }
>
> At the moment not even echoing my $sql works. I know this aint gonna work as it is, 
>because what I really need to know is:
>
> * How do I insert into only those categories that have been checked? (default is 
>'null' in a VARCHAR(50) field)
> * How do I only declare '$email' a single time as this is the only value being 
>inserted?
>
> Many thanks:
> Russ
>
> #---#
>
>   "Believe nothing - consider everything"
>
>   Russ Michell
>   Anglia Polytechnic University Webteam
>   Room 1C 'The Eastings' East Road, Cambridge
>
>   e: [EMAIL PROTECTED]
>   w: www.apu.ac.uk/webteam
>
>   www.theruss.com
>
> #---#


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Multiple upload

2001-10-02 Thread bill

 http://www.php.net/manual/en/features.file-upload.multiple.php

Its Me wrote:

> is there a way i can upload more than one file in the same page
> -ofcourse in 2 different form fields-???
>
> 
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: How to test if mysql_fetch_array returns no results ?

2001-09-21 Thread Bill Blancett

Disregard the previous post. I figured out that mysql_num_rows() returns the
number of rows from the result of a SELECT query.

"Bill Blancett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am new to PHP so I am need someone to explain this problem to me. I am
> trying to read items from a table and store them into an array. My current
> function of choice to use is "mysql_fetch_array". The documentation says
> that it returns FALSE if there are no more rows returned, but yet when the
> query does not return a result set, It does not return anything. So the
> basic question is how do I test for a query that does not return for any
> results ? Here is some of my code below:
>
> $result = mysql_db_query ("GradAdmissions","select * from applicant where
> applicant_id = 17");
> while ($row = mysql_fetch_array ($result))
>{
> echo "applicant_id: ".$row["applicant_id"]."\n";
> echo "member_id: ".$row["member_id"]."\n";
> }
> mysql_free_result ($result);
>
> Thanks in advance
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] How to test if mysql_fetch_array returns no results ?

2001-09-21 Thread Bill Blancett

 I am new to PHP so I am need someone to explain this problem to me. I am
trying to read items from a table and store them into an array. My current
function of choice to use is "mysql_fetch_array". The documentation says
that it returns FALSE if there are no more rows returned, but yet when the
query does not return a result set, It does not return anything. So the
basic question is how do I test for a query that does not return for any
results ? Here is some of my code below:

$result = mysql_db_query ("GradAdmissions","select * from applicant where
applicant_id = 17");
while ($row = mysql_fetch_array ($result))
   {
echo "applicant_id: ".$row["applicant_id"]."\n";
echo "member_id: ".$row["member_id"]."\n";
}
mysql_free_result ($result);

Thanks in advance



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: reading arrays within a field from mysql and separating the values

2001-09-13 Thread bill

You need to split the value into an array using php, then list it out.

Lots of ways to do that, here's one.

$result4 = mysql_query( "SELECT DCD_Access FROM userdb WHERE ID =
'$user_ID'");
$DCD = mysql_fetch_array ( $result4 );

print " \n
\n
\n
None\n
Within Gel\n";

// new stuff
$vals= explode(", ", $DCD["DCD_Access"]);
for ($i=0;$i$vals[$i]\n";
}
// end new stuff



print "   \n
  \n";

Robert Trembath wrote:

> Hello everyone,
>
> Ran into a problem trying to get this to work. I have multiple names in a
> mysql field (DCD_Access) that contains "name1, name2, name3, name4" and I
> want read this information as an array so I can use these values to populate
> a pull-down list using a while or foreach loop. Below is the code I used,
> but I get the values as a single entry no matter what I try. This query
> brings a single result row "name1, name2, name3, name4". Here's the code:
>
> $result4 = mysql_query( "SELECT DCD_Access FROM userdb WHERE ID =
> '$user_ID'");
> $DCD = mysql_fetch_array ( $result4 );
>
> print " \n
> \n
> \n
> None\n
> Within Gel\n";
> foreach ( $DCD as $val )
> {
> print "$val\n";
> }
> print "   \n
>   \n";
>
> This returns HTML like:
>
> 
> 
> 
> None
> Within Gel
> name1, name2, name3,
> name4
> name1, name2, name3,
> name4
> name1, name2, name3,
> name4
> name1, name2, name3,
> name4
>  
>  
>
> What I need is to get:
>
> 
> 
> 
> None
> Within Gel
> name1
> name2
> name3
> name4
>  
>  
>
> Anyone know how to fix this?
> Robert


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Make Money For Sending E-mail

2001-09-01 Thread fred . bill

Dear [EMAIL PROTECTED],


> BE A MILLIONAIRE LIKE OTHERS WITHIN A YEAR!!! > >
> Before you say ''Bull'', please read the following.>
> This is the letter > you > have been hearing about
> on the news lately. Due to> the popularity of > this
> letter on the Internet, a national weekly news>
> program recently > devoted > an entire show to the
> investigation of this program> described below, to >
> see > if it really can make people money. The show
> also> investigated whether or > not the program was
> legal. Their findings proved once and for all
> that there> are ''absolutely NO > Laws > prohibiting
> the participation in the program and if> people can
> -follow > the > simple instructions, they are bound
> to make some> mega bucks with only > $25 out of
> pocket cost''. DUE TO THE RECENT INCREASE> OF >
> POPULARITY & RESPECT THIS PROGRAM HAS ATTAINED, IT
> IS CURRENTLY WORKING BETTER THAN EVER. > > This is
> what one had to say: ''Thanks to this> profitable
> opportunity. I > was approached many times before
> but each time I> passed on it. I am > so glad I
> finally joined just to see what one could> expect in
> return for > the > minimal effort and money
> required. To my> astonishment, I received total
> $610,470.00 in 21> weeks, with money still coming
> in." > Pam Hedland, Fort Lee, New Jersey. 
> ===
> > > Here is another testimonial: "This program has
> been> around for a long > time but I never believed
> in it. But one day when I> received this again > in
> the mail I decided to gamble my $25 on it. I>
> followed the simple > instructions and walaa . 3
> weeks later the money> started to come in. > First
> month I only made $240.00 but the next 2> months
> after that I made > a total of $290,000.00. So far,
> in the past 8 months> by re-entering the > program,
> I have made over $710,000.00 and I am> playing it
> again. The > key to success in this program is to
> follow the> simple steps and NOT > change >
> anything.'' More testimonials later but first, 
> = PRINT THIS NOW FOR YOUR FUTURE REFERENCE
>
>
$>
> > If you would like to make at least $500,000 every
> 4> to 5 months easily > and > comfortably, please
> read the following...THEN READ> IT AGAIN and
> AGAIN!!! >
>
$>
> > > FOLLOW THE SIMPLE INSTRUCTION BELOW AND YOUR>
> FINANCIAL > DREAMS WILL COME TRUE, GUARANTEED!
> INSTRUCTIONS: > > =Order all 5 reports shown on
> the list below> = > > For each report, send $5
> CASH, THE NAME & NUMBER OF> THE REPORT > YOU ARE
> ORDERING and YOUR E-MAIL ADDRESS to the> person
> whose > name appears ON THAT LIST next to the
> report. MAKE> SURE YOUR RETURN > ADDRESS IS ON YOUR
> ENVELOPE TOP LEFT CORNER in case> of any mail >
> problems. > > === When you place your order, make
> sure you order> each of the 5 reports. > You will
> need all 5 reports so that you can save> them on  
> your computer > and resell them. YOUR TOTAL COST $5
> X 5=$25.00. > > Within a few days you will receive,
> vie e-mail, each> of the 5 reports > from > these 5
> different individuals. Save them on your> computer
> so they will be > accessible for you to send to the
> 1,000's of people> who will order them > from you.
> Also make a floppy of these reports and> keep it on
> your desk in case something happen to> your
> computer. > > IMPORTANT - DO NOT alter the names of
> the people who> are listed next > to each report, or
> their sequence on the list, in> any way other than
> what is instructed below in step> '' 1 through 6 ''
> or you will loose out on majority > of your profits.
> Once you understand the way this> works, you will
> also > see how it does not work if you change it.
> Remember,> this method has been > tested, and if you
> alter, it will NOT work !!!> People have tried to
> put > their > friends/relatives names on all five
> thinking they> could get all the > money. But it
> does not work this way. Believe us, we> all have
> tried to be greedy and then nothing> happened. So Do
> Not try to change anything other> than what is
> instructed. Because if you do, it will> not work for
> you. > > Remember, honesty reaps the reward!!! > >
> 1 After you have ordered all 5 reports, take>
> this advertisement and > REMOVE the name & address
> of the person in REPORT #> 5. This person > has made
> it through the cycle and is no doubt> counting their
> fortune. > 2 Move the name & address in REPORT #
> 4 down TO> REPORT # 5. > 3 Move the name &
> address in REPORT # 3 down TO> REPORT # 4. > 4
> Move the name & address in REPORT # 2 down TO>
> REPORT # 3. > 5 Move the name & address in
> REPORT # 1 down TO> REPORT # 2 > 6 Insert YOUR
> name & address in the REPORT # 1> Position. > >
> PLEASE MAKE SURE you copy every name & address>
> ACCURATELY! > >
>
=

Re: [PHP-DB] Re: Photo Album Schema

2001-08-24 Thread Bill Zeller

Hi,

By saying id.gif, I obviously didn't mean the id of
the user, I meant the unique id of the image.

I assumed the person making this was going to have one
table setup like so:

id (unique id)
owner
name
description
jpg_or_gif, etc

Then a table with authors..

id
name
pass
email
etc

with author.id = picture.owner

I see no downside to doing that and it seems to be a
relatively effecient way to ensure the uniqueness of
all image names.

Best Regards,
Bill Zeller
--- Sheridan Saint-Michel <[EMAIL PROTECTED]>
wrote:
> I don't know if having multiple users associated
> with a single image is
> at all beneficial, and I can see where it might
> cause all sorts of problems.
> 
> For example, you and I both have the same image in
> our album (we are
>  both assciated with it in the DB).  What happens
> when I change the
> description?  Do you change the description field,
> thus changing the
> description on both our pages?  Do you now have to
> create another entry
> in your Image table?  In effect anytime I change the
> description either both
> of us have to live with my new description or you
> have to do a lot of work
> around code (checking to see if more than one person
> is associated with the
> image, Adding a new entry into image, changing all
> my info to reflect the
> new
> Image_Name) to avoid this.
> 
> Therefore, I think for this project, the original DB
> structure works much
> better.
> 
> Sheridan Saint-Michel
> Website Administrator
> FoxJet, an ITW Company
> www.foxjet.com
> 
> - Original Message -
> From: "grant" <[EMAIL PROTECTED]>
> To: "Sheridan Saint-Michel" <[EMAIL PROTECTED]>
> Cc: "Bill Zeller" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Thursday, August 23, 2001 1:48 PM
> Subject: Re: [PHP-DB] Re: Photo Album Schema
> 
> 
> > The most useful schema would be to have the name
> of the document be system
> > generated, like i123456789.img and make the
> database as follows:
> >
> > Image
> > Image_Name varchar(50) primary key
> > Original_Name varchar(50)
> > Description text
> >
> > User
> > User_ID int8 primary key
> > Login char(8) uniques index
> > password varchar(50) encrypted
> >
> > relation
> > User_ID
> > Image_Name
> >
> > Now you have duplicate anems OK, multiple users
> associated with any
> > picture.  You just rename the file as it comes and
> goes.
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: Photo Album Schema

2001-08-23 Thread Bill Zeller

Hi,

I can see absolutely no reason to store the name of
the image with the picture?

Why not, whether using one directory or one for each
user, just do id.gif?

Best Regards,
Bill Zeller
--- Steve Brett <[EMAIL PROTECTED]> wrote:
> that would generally work on the assumption that
> many photos can belong to
> many albums. possibly a bad thing.
> 
> > table 1
> > > -userid (primary key)
> > > -username
> > > -password
> > > -album_title
> > > -creation_date
> >
> > table 2
> > > -photoid (primary key)
> > > -photo (jpg or gif)
> > > -date
> > > -photo_title
> > > -description (limited length)
> > > -userid (foreign key)
> 
> would give you 1 album contains many photos, each
> photo relating to one
> album only.
> 
> Steve
> 
> 
> 
> "Tatare" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I'd rather do it like this (but I'm not sure it's
> ok...)
> >
> > table 1
> > > -userid (primary key)
> > > -username
> > > -password
> > > -album_title
> > > -creation_date
> >
> > table 2
> > > -photoid (primary key)
> > > -photo (jpg or gif)
> > > -date
> > > -photo_title
> > > -description (limited length)
> >
> > table 3
> > > -userid (primary key)
> > > -photoid (primary key)
> >
> > reguards.
> > tatare,
> > http://www.memoroo.fr.st
> > (not already available in english - could anyone
> help me to translate it
> ?)
> >
> > Jeff Oien <[EMAIL PROTECTED]> a écrit dans le
> message :
> >
> [EMAIL PROTECTED]
> > > I want to make a photo album that will have
> users who sign up
> > > to create an album and then have the albums open
> to the public.
> > > I was thinking of doing it like this but I've
> never done a relational
> > > database before so if anyone thinks of anything
> I should change
> > > please let me know. Thanks.
> > > Jeff Oien
> > >
> > > Table1:
> > > -username
> > > -password
> > > -album_title
> > > -creation_date
> > > -id
> > >
> > > Table2:
> > > -id (from Table1)
> > > -photo (jpg or gif)
> > > -date
> > > -photo_title
> > > -description (limited length)
> >
> >
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Resolution detect and redirect

2001-08-10 Thread bill

Does it work when Javascript is turned off in the client browser?

Cara Lane - Designs In The Fast Lane wrote:

> I have noticed many posting about this topic and the overall answer seems to
> be it can't be done.  Well, it can!
>
> I actually finally got it to work. It is actually quite simple. I think I
> was trying to make it too hard. FYI, here is the code in case anyone else
> has this problem:
> This goes above  on the page you need the php include code in.
>  if( !IsSet($w) )
> die(' type="text/javascript">window.location.replace("http://www.theairwaysite.com
> /restest.php?w=" + screen.width)');
> ?>
> This goes where the php include need to show on the page:
>  echo include('header'.$w.'.htm');
> ?>
> Then you just have to name your headers for the resolution, ie
> header800.htm, header1024.htm, etc...
> Works like a dream!
> It chooses a header based on the screen resolution of the user and includes
> it in the proper place for the php include.
>
> Cara Lane
> 214-868-9348
> www.designsinthefastlane.com
> www.dallasbarterexchange.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: MySQL/PHP Troubles :( anyone have a solution?

2001-08-03 Thread bill

You're not echoing anything back to the browser.

For example change this:

if ($action == "logout")
{
  unset ($login_user);
  unset ($login_password);
  unset ($action);
}

to this:

if ($action == "logout")
{
  echo "You chose to log out";
  unset ($login_user);
  unset ($login_password);
  unset ($action);
  echo "Thanks, you are now logged out.";
}

It might also help prevent confusion if you indented your code for each level of
curly brackets "{ }" you use.  Having all your brackets flush left is tough to
read.

kind regards,

bill hollett

Kenneth Groth wrote:

> Greetings, all :) I'm looking for a PHP god, or at least someone who has the
> answer to my problem.  I have a script for a login system that can handle
> multiple users at http://www.stoneneedle.f2s.com/loginsystem2.php3 (
> http://www.stoneneedle.f2s.com/loginsystem2.txt is the source code, some may
> have to click 'view source' in their browsers) - but it does not work.try
> it-use handle "new_handle" with password "somepwd" ...that's one of the
> things in the MySQL database.  oh, the login works great.  but those options
> in the select box don't - both take me to a nasty white screen of death when
> I try to log out or change password the coding appears OK to a friend of
> mine and excellent PHP coder.  Is there something I missed?
> -Stoney
> P.S. - I know that the mysql_connect () is not given a password...because,
> after all, I'm not putting in my MySQL database pass in there :P


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] managing variant data

2001-06-26 Thread bill

I would create another table called "extras" that include all possible extra
choices.  This table has a SpeciesID field to assign it to a species.

A third table called "details" could have OfficerID and ExtrasID and ExtrasValue
fields.  That way you could have as many or as few extras as you want.

Filling out the data requires two forms.  The first just gets the basic officer
info.  The second grabs the officerID and Species and displays only those "Extras"
that pertain to that species.  Submitting the info populates the "details" table.

Queries link the officer & details tables on OfficerID.  You can link the extras &
details tables on the ExtrasID when you need.

kind regards,

bill hollett

Jesse Scott wrote:

> Hi again, another conundrum.
>
> What is the best way to deal with the following situation?
>
> You have a group of common properties including a property that indicates a
> second group of common properties.  For example,
> suppose you have this table:
>
> Officers
> 
> Name
> Rank
> Age
> Height
> Weight
> Species
>
> The 'Species' property may have the following values: Vulcan, Human,
> Klingon, or Android.
>
> If (Species==Vulcan) then you want to store these additional properties:
> MindmeldCount and YearsOnVulcan
> If (Species==Klingon) then you want to store these additional properties:
> NumberofConcealedWeapons and RidgesOnForehead
> If (Species==Android) then you want to store these additional properties:
> PositronicBrain and MemoryJigas
> If (Species==Human) then you want to store these additional properties:
> AttendedStarfleetAcademy and BloodType
>
> The problems I want to avoid are:
> 1) placing all the properties for all species in the Officers table (as
> this would include unnecessary properties for each row) and
> 2) storing the properties in the Officers in four seperate tables
> (Klingons, Humans, Androids, and Vulcans) redundantly.
>
> Should additional tables be created: Vulcans, Klingons, Androids, Humans?
> If so, how should these tables be joined to Officers?
>
> In an object language I would solve a problem like this be creating a base
> class with the Officers properties and then deriving new classes from this
> base class using inheritance.  How do I solve this problem in a database
> setting?
>
> Thanks in advance for your help,
>
> Jesse
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] image upload -> mime types??

2001-05-21 Thread bill

Hi Matthew,

I ignore both the mime-type and the extension,  and assume mistakes (sooner or
later) by the user.

Running getimagesize() on the file will show what image type it is by actually
looking at the file.  If it isn't one of those types, I delete it.  If it is a
correct type, I force the correct extension on it to prevent errors.

kind regards,

bill

matthew knight wrote:

> i've created an application where users can upload images through the form
> upload, and to ensure that they are sending me an image, i take a look at
> the type of the file (ie. $uploadedfile_type), which usually returns
> something like
>
> image/x-png
>
> however.. not always.. so secondly, i check for a file extension using
> $uploadedfile_name, but if they've loaded it from a mac.. i can't be sure
> there will be a filename.. so, those things both failing in some cases.. is
> there any other way of checking the filetype of a file?
>
> i'm concerned that some could upload malicious content and run it (although
> the execute flag is turned off, AND the filename is difficult to get.. ) and
> would like to reduce the possiblity..
>
> any suggestions?
>
> --
> matthew knight - online developer
> [EMAIL PROTECTED]
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] newbie MySQL question

2001-05-19 Thread bill

On Sat, 19 May 2001, Matt Nigh wrote:

> hi, i'm building a website right now with a shows page on it which will
> scroll horizontally in a window. i have each show listed in a table called
> shows (db is called almavale_board) with the following fields:
>
> id - bandplaying - venue - date - time - cover - description

you could put the band info in another table and reference them by bandid
or something. this would make it easier to expand, like if you ever wanted
to collect stats on each band (like members, genre, etc.).

i only mention this because i did a calendar of events page a while back
and eventually went to such a format. it is much easier this way because
each event was only listed in the database once. just a thought...

> what i need to do is have the shows listed by date, having the latest date
> listed first. here's the code i have presently:
>
> [ code snip ]
>
> oh and the date is in this format : Month-Day-,Year (ex. May 19, 2001)
>
> if anyone can help me out on this at all (or has any questions about my
> problem), please reply to this post, i'd be very appreciative.

how is the date column defined in mysql... is it a DATE type? ... if so
the date would look something like 2001-05-19 in mysql, and you could use
something like:

   SELECT DATE_FORMAT(date, '%M %d, %Y'), ...
   FROM shows
   ORDER BY date DESC

and mysql would sort and format the date as necessary. like this:

mysql> select DATE_FORMAT(date, '%M %d, %Y') from dates order by date
desc;

+--+
| DATE_FORMAT(date, '%M %d, %Y')   |
+--+
| March 31, 2001   |
| March 29, 2001   |
| March 28, 2001   |
| March 28, 2001   |
| March 27, 2001   |
| March 24, 2001   |
...

hope this helps... :)



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Selecting number of news items on frontpage

2001-02-28 Thread Bill Zeller

Hey,

If you're using Mysql to store the items, you could
use the Limit statement to limit the number of items
displayed. If you're using the file system it'd
probably be a little more difficult, but not
impossible. For example, if the news items were stored
in a text file with one entry per line, you could just
use file() to convert the file to an array and then
loop 7 times--grabbing the first 7 elements (or news
items) of the array.

Best Regards,
Bill Zeller
--- Matthew Cothier <[EMAIL PROTECTED]>
wrote:
> I have a homepage which has a news headline system.
> Bascially via form the 
> admin of the site can submit news which appears on
> the front page, the only 
> problem is the news just keeps coming and I have a
> front page with too many 
> headlines on.
> 
> How can I make it so that say 7 articles appear on
> the front page and the 
> rest can be accessed through some sort of archive?
> 
> Perhaps a link underneath these articles to the
> archive?
> 
> And the actual archive a page with the headlines
> listed that they can click 
> on and view the story, the headlines listed in date
> order.
> 
> How would I do this?
>
_
> Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com.
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] SQL Select statement

2001-02-16 Thread bill

I have a table with three simple columns: id(unique), memberID, and
choice


I want to find out which memberIDs have BOTH choice 2 AND choice 3.

--> SELECT memberID from table where choice=2 AND choice = 3

That won't work (0 results, of course, because no row has two choices,
they're mutually exclusive)

---> SELECT memberID from table where choice=2 OR choice = 3

That doesn't work (shows all memberIDs that chose either 2 or 3).

Can I maybe join the table upon itself on the memberID?

Other suggestions?

thanks,

bill hollett


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]