[PHP-DB] sortable list w/php ajax

2007-07-25 Thread Bryan
Anyone modify the scripts at 
http://www.phpriot.com/d/articles/client-side/sortable-lists-with-php-and-ajax/index.html? 
 I'm just looking to include more fields in the listing and possibly in 
tables. An option to move one at a time to the top of the list by 
clicking a button on each line would be nice. I've got the script to 
work, just not with multiple fields and the other additions.


The parts that would probably need the changes are:

$books = array();
while ($row = mysql_fetch_object($result)) {
   $books[$row-tablekey] = $row-title;
}
return $books;

---
(builds the array) and
---

ul id=books_list class=sortable-list
   ? foreach ($books as $tablekey = $title) { ?
  li id=book_?= $tablekey ??= $title ?/li
   ? } ?
/ul

---
lists the fields out

I'd really like to change out the list with a table...

Thanks...

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



Re: [PHP-DB] sql statement - complex order by

2007-07-02 Thread Bryan
I think there's one small piece of data I left out. I'm working with 
php/mssql, no mysql. I'll move to mysql when I get everything else 
built. Mssql 2000 doesn't seem to like the = sign in the order by 
clause. It looks like both of you so far have come up with the same 
syntax though so it must work on mysql. ;-)


Thanks guys...

[EMAIL PROTECTED] wrote:

Try this:

SELECT * FROM productgroup WHERE groupid = $productid
ORDER BY label = 'Cats' DESC, title

The test SQL I did to make sure I understood it was this (against our Users 
table):

select * from users order by first = 'Bob' DESC, first, last

It put all the Bobs first, sorting them by first/last, then put everyone else after the 
Bobs sorted by first/last.

If you don't put DESC on the 'Cats', it looks like it'll put the 'Cats' at the 
bottom of the list.

Also refer to the user comments here:
http://dev.mysql.com/doc/refman/4.1/en/sorting-rows.html

good luck!

-TG

= = = Original message = = =

SELECT * FROM productgroup WHERE groupid = $productid
AND label =  'Cats' ORDER BY title

SELECT * FROM productgroup WHERE groupid = $productid
AND label != 'Cats' ORDER BY label,title

I'd like to find a way to combine these 2 statements. I want to list out 
all the products, ordered by title but listing out all the Cats products 
first. Any way to do that without having separate statements?


Thanks...



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



Re: [PHP-DB] sql statement - complex order by

2007-07-02 Thread Bryan
I think there's one small piece of data I left out. I'm working with 
php/mssql, not mysql. I'll move to mysql when I get everything else 
built. Mssql 2000 doesn't seem to like the = sign in the order by 
clause. It looks like both of you so far have come up with the same 
syntax though so it must work on mysql. ;-)


Thanks guys...

[EMAIL PROTECTED] wrote:

Try this:

SELECT * FROM productgroup WHERE groupid = $productid
ORDER BY label = 'Cats' DESC, title

The test SQL I did to make sure I understood it was this (against our Users 
table):

select * from users order by first = 'Bob' DESC, first, last

It put all the Bobs first, sorting them by first/last, then put everyone else after the 
Bobs sorted by first/last.

If you don't put DESC on the 'Cats', it looks like it'll put the 'Cats' at the 
bottom of the list.

Also refer to the user comments here:
http://dev.mysql.com/doc/refman/4.1/en/sorting-rows.html

good luck!

-TG

= = = Original message = = =

SELECT * FROM productgroup WHERE groupid = $productid
AND label =  'Cats' ORDER BY title

SELECT * FROM productgroup WHERE groupid = $productid
AND label != 'Cats' ORDER BY label,title

I'd like to find a way to combine these 2 statements. I want to list out 
all the products, ordered by title but listing out all the Cats products 
first. Any way to do that without having separate statements?


Thanks...



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



[PHP-DB] IN clause

2007-06-26 Thread Bryan
If I have a SQL statement using the IN clause, how do I keep the order 
of the list?


Example:
SELECT * FROM table WHERE (number in (5, 9, 3, 4, 1, 7, 2, 8, 6))

How would I pull records in the order of the numbers to list out as:
5 - Record 5
9 - Record 9
3 - Record 3
4 - Record 4
1 - Record 1
7 - Record 7
2 - Record 2
8 - Record 8
6 - Record 6

Thanks so much...

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



[PHP-DB] Re: IN clause

2007-06-26 Thread Bryan
By the way, I want the numbers to list out in the order I have them in 
the statement, not numerically and not randomly like it does now.


Thanks...

Bryan wrote:
If I have a SQL statement using the IN clause, how do I keep the order 
of the list?


Example:
SELECT * FROM table WHERE (number in (5, 9, 3, 4, 1, 7, 2, 8, 6))

How would I pull records in the order of the numbers to list out as:
5 - Record 5
9 - Record 9
3 - Record 3
4 - Record 4
1 - Record 1
7 - Record 7
2 - Record 2
8 - Record 8
6 - Record 6

Thanks so much...


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



[PHP-DB] Re: IN clause

2007-06-26 Thread Bryan
Thanks to Benno Rem for pointing out the ORDER BY FIELD(..) that one can 
use in MySQL. Now to find a way to use it in MSSQL 2000. Wrong group for 
that I guess. 8-O


Bryan wrote:
By the way, I want the numbers to list out in the order I have them in 
the statement, not numerically and not randomly like it does now.


Thanks...

Bryan wrote:
If I have a SQL statement using the IN clause, how do I keep the order 
of the list?


Example:
SELECT * FROM table WHERE (number in (5, 9, 3, 4, 1, 7, 2, 8, 6))

How would I pull records in the order of the numbers to list out as:
5 - Record 5
9 - Record 9
3 - Record 3
4 - Record 4
1 - Record 1
7 - Record 7
2 - Record 2
8 - Record 8
6 - Record 6

Thanks so much...


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



[PHP-DB] Re: mssql connecting

2007-05-29 Thread Bryan
I've tried installing php-mssql-5.0.4-10.1.i386.rpm and it shows that it 
needs the dependency of libsybdb.so.5. So I try to install 
freetds-0.64-1.rh9.rf.i386.rpm and it shows that it needs the dependency 
of libreadline.so.4. I check my server and it already has 
libreadline.so.5. What do I need to do now? Any help would be extremely 
appreciated. ;-) Maybe if someone in the Austin, Texas area can help, I 
can give them a discount on a bass fishing guide trip. LOL Thanks...


Bryan wrote:
I'm trying to connect to mssql 2000 on a windows server 2003 standard 
box using php v5.1.6/apache 2.2.2 fedora core 4 on a separate box, of 
course. Any ideas?


It just gives me the wonderful error: SQL error: [unixODBC][Driver 
Manager]Data source name not found, and no default driver specified, SQL 
state IM002 in SQLConnect in file.


I also have Plesk 8.1 on the linux box so if I need to recompile php, 
would it break anything? I've installed freetds as well but haven't 
recompiled php questioning the above.


Thanks for any and all help...


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



[PHP-DB] Re: mssql connecting

2007-05-29 Thread Bryan
I'm trying to connect from a totally different server. I don't think SP4 
has anything to do with it. Thanks though. ;-)


Sady Marcos wrote:

Install SP4 of the SQL Server

Bryan [EMAIL PROTECTED] escreveu na mensagem 
news:[EMAIL PROTECTED]
I've tried installing php-mssql-5.0.4-10.1.i386.rpm and it shows that it 
needs the dependency of libsybdb.so.5. So I try to install 
freetds-0.64-1.rh9.rf.i386.rpm and it shows that it needs the dependency 
of libreadline.so.4. I check my server and it already has 
libreadline.so.5. What do I need to do now? Any help would be extremely 
appreciated. ;-) Maybe if someone in the Austin, Texas area can help, I 
can give them a discount on a bass fishing guide trip. LOL Thanks...


Bryan wrote:
I'm trying to connect to mssql 2000 on a windows server 2003 standard box 
using php v5.1.6/apache 2.2.2 fedora core 4 on a separate box, of course. 
Any ideas?


It just gives me the wonderful error: SQL error: [unixODBC][Driver 
Manager]Data source name not found, and no default driver specified, SQL 
state IM002 in SQLConnect in file.


I also have Plesk 8.1 on the linux box so if I need to recompile php, 
would it break anything? I've installed freetds as well but haven't 
recompiled php questioning the above.


Thanks for any and all help... 


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



[PHP-DB] mySQL - can connect with mysqlcc but not PHP code

2004-12-03 Thread Bryan Green
So here's the problem: I can connect to a mySQL database on localhost just
fine with a PHP test script I've written, but I cannot connect to a remote
server, even though I can connect to the remote server just fine with
mySQL Control Center. Anybody have any suggestions? Here's a snippet of my
code, if it helps:

--- 
@ $db = mysql_pconnect($myhost, $myuser, $mypass); 
if (!$db) 
{
echo Error: could not connect to DB.; exit;
}
mysql_select_db(test);
echo Connection established!;
--- 

And I have verified that the variables $myhost, $myuser, and $mypass
contain the correct connection data.

Thanks a million!
Bryan Green

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



RE: [PHP-DB] php variables to JS

2003-01-05 Thread Bryan McLemore
Could always pass it through a hidden form.

Bryan


-Original Message-
From: Bruce Levick [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, January 05, 2003 1:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] php variables to JS

Bruce Levick - VivamotionI am opening a chromless window with some JS
code.
I need to pass some variables which come from rows in my database into
the
jscript which will determine the size and URL of the window.

Before I go about drawing the info from the database I have set up some
hard
code php variables just so i could test how to pass these into js.

Does anybody know how I can code these variables into my jscript??

Cheers

##
?php
$h = 600;
$w = 343;
$theURL = test.php;
$wname = test;
?
###

##
script language=javaScript type=text/javascript
SRC=js/java.js/SCRIPT

script
!--
function openIT() {
theURL=wesley.php//php variable here
wname =CHROMELESSWIN  //php variable here
W=300;  //php variable here
H=100;  //php variable here
windowCERRARa = images/close_a.gif
windowCERRARd = images/close_d.gif
windowCERRARo = images/close_o.gif
windowNONEgrf = images/none.gif
windowCLOCK = images/clock.gif
windowREALtit = nbsp;? Task title
windowTIT = font face=verdana size=1nbsp;your chromless/font
windowBORDERCOLOR = #00
windowBORDERCOLORsel = #00
windowTITBGCOLOR = #FF0033
windowTITBGCOLORsel = #FF0033
openchromeless(theURL, wname, W, H, windowCERRARa, windowCERRARd,
windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit ,
windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR,
windowTITBGCOLORsel)
}
//--
/script
##



-- 
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] advise needed for 'authorized only' site

2002-09-23 Thread Bryan McLemore

you could make them log in once per session and just have every page check
and see if they already have logged in and if they have not then trigger the
login mechanism.

Not sure exactly how to implement but I've read on the practice before.

-Bryan

- Original Message -
From: [EMAIL PROTECTED]
To: PHP_DB [EMAIL PROTECTED]
Sent: Monday, September 23, 2002 10:14 AM
Subject: [PHP-DB] advise needed for 'authorized only' site


 I have set up a section of my company site for use by authorized dealers
 only. I am currently using
 mysql authorization, which works for the first page, but if someone were
to
 type in the url of an
 underlying page they would be able to get in without authorization. I know
 I could use .htaccess
 for handling this but with a minimum of 350 -400 users to keep track of
 that would be unwieldly to
 say the least, especially for my boss who doesn't have a clue about *nix
 and has never even heard
 of .htaccess.

 What other options do I have to keep the underlying pages from being
 accessed without the user
 being forced to go through the logon screen?

 Thanks,

 --
 Chip Wiegand
 Computer Services
 Simrad, Inc
 www.simradusa.com
 [EMAIL PROTECTED]

 There is no reason anyone would want a computer in their home.
  --Ken Olson, president, chairman and founder of Digital Equipment
 Corporation, 1977
  (They why do I have 9? Somebody help me!)


 --
 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] SQL file,

2002-09-21 Thread Bryan McLemore

in an example I saw in a book while I was leafing through it at barnes and nobles I 
saw a .sql file.  It appeared to have the schema for a db in it.  I was wondering what 
exactly what it is and how one could use it in a php application like he was doing.  

Thanks,
Bryan 



[PHP-DB] PHP Editor?

2002-09-06 Thread Bryan McLemore

First off, What html/php editor do you guys think is better?

Secondly, perhaps a little more relevant to the database part of this.  I just want to 
clarify that with mysql_query() I can send any valid sql expression and it will do 
that?

-Bryan



[PHP-DB] SQL Query

2002-09-06 Thread Bryan McLemore

Hi Guys I have written this SQL Query :

CREATE TABLE tasks (id INT AUTO_INCREMENT, name VARCHAR(50), desc TEXT, address 
VARCHAR(50), startDate DATE, lastWork DATE, progress INT(3))

I'm sending it in through php and I can't get it to work correctly.  Please help.  
Also, I would like to make id the primary key/index

-Bryan



Re: [PHP-DB] Re: mysql_connect

2002-09-05 Thread Bryan McLemore

Sorry about the private email didn't mean too.  The email header shows you
as it being from you and when I hit reply it defaults to go to you.  Sorry
bout that.

Well on the goodside I got it fixed.  Thanks for the feedback.  The thing
that got me was not having root has the user.  Well thanks.

Bryan

- Original Message -
From: David Robley [EMAIL PROTECTED]
To: Bryan McLemore [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, September 05, 2002 8:26 PM
Subject: Re: [PHP-DB] Re: mysql_connect


 On 3 Sep 2002 at 23:00, Bryan McLemore wrote:

  - Original Message -
  From: David Robley [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, September 03, 2002 9:31 PM
  Subject: [PHP-DB] Re: mysql_connect
 
 
   In article 000c01c253b2$506d7530$0101a8c0@fwcmain,
   [EMAIL PROTECTED] says...
I'm trying to connect using the sample code in the php
documentation.
  IT however dies every time.  If someone could please help me?  Thanks. 

BryanCan you show the code you are using, and any error
  messages you get?   --  David Robley  Temporary Kiwi!   Quod
subigo
  farinam   --  PHP Database Mailing List (http://www.php.net/)  To
  unsubscribe, visit: http://www.php.net/unsub.php 

 Love the formatting by your mail pkg - OE of course :-)

  The code is
 
  $link = mysql_connect(localhost:3306, UserName, Password)
   or die(Could not connect);
 
  Thanks,
  Bryan McLemore

 May I suggest you keep the discussion on the mailing list - a) you have
 the entire list's expertise to draw on, b) the solution is shared with
 others who may benefit and c) you may get a quicker answer.

 Now, you haven't said so, but I assume you are getting 'Could not
 connect'?

 So, points to check:

 1) mysql is running, and on port 3306; note that you don't need to
 specify the port usually
 2) the username and password are correct - try the command line version
 to check that the user/pass are accepted (assuming you have command line
 access)
 3) remove the 'or die' construct and see if you get an error message


 --
 David Robley
 Temporary Kiwi!
 Quod subigo farinam

 My grape juice has fermented, Tom whined.



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

2002-09-03 Thread Bryan McLemore

I'm trying to connect using the sample code in the php documentation.  IT however dies 
every time.  If someone could please help me?  Thanks.

Bryan



[PHP-DB] MySQL/PHP

2002-08-30 Thread Bryan McLemore

Where can I find a good manual/tutorial on how to access mySQL w/PHP.  Keep in mind 
that I am new to both PHP and mySQL, and my database theory is sketchy at best.

Thanks.



Re: [PHP-DB] Re: Error Loading File -- Sort of Fixed

2002-06-13 Thread Bryan Gintz

Ok, if anyone else is having the same trouble with PHP 4.2.1, David 
Robley's suggestion (Thank you David!) works.  I am not to proud to have 
missed the obvious :)

If you are having trouble loading files (LOAD INFILE...) with PHP into 
MySQL, just do a chmod($file, 0777), and it works.  Not sure why this 
version of PHP doesn't give full permissions in the /tmp directory, but.

Thanks all.

David Robley wrote:

In article [EMAIL PROTECTED], [EMAIL PROTECTED] says...

Whoops :),
Yes, this is using phpMyAdmin, trying to use the Insert data from a 
textfile into table function, which uploads a file and the attempts to 
LOAD DATA INFILE.  Like I said below, it worked on PHP 4.1.2, then when 
upgraded to PHP 4.2.1, it gave the error :

The file '/tmp/phpr4WYQY' must be in the database directory or be 
readable by all

I ran through the phpMyAdmin scripts and watched it up until it tried to 
load the file, and it wouldn't read it.  The /tmp directory is 
drwxrwxrwx and the files in it are -rw--, but I don't know how 
to get those changed in PHP.  Anyway, on a different server, I could 
have sworn I got the same problem but the uploaded files in the /tmp 
directory were -rwxrwxrwx.  

Any ideas?

Thanks

David Robley wrote:

In article [EMAIL PROTECTED], [EMAIL PROTECTED] says...

I am getting this error with a new install of PHP4.2.1 and Zend 
Optimizer 1.3.1:

The file '/tmp/phpr4WYQY' must be in the database directory or be 
readable by all

I just updated PHP and the Zend Optimizer, and it had worked previously 
with PHP4.1.2,

Any ideas??

Because you are asking on the db list, I'll guess that you are trying to 
use LOAD DATA INFILE? The file you are trying to load needs to be world 
readable if it isn't in the database directory.

If this isn't the problem, can you be a bit more specific about the 
circumstances in which this error appears?


chmod() ??





Re: [PHP-DB] Re: Error Loading File

2002-06-12 Thread Bryan Gintz

Whoops :),
Yes, this is using phpMyAdmin, trying to use the Insert data from a 
textfile into table function, which uploads a file and the attempts to 
LOAD DATA INFILE.  Like I said below, it worked on PHP 4.1.2, then when 
upgraded to PHP 4.2.1, it gave the error :

The file '/tmp/phpr4WYQY' must be in the database directory or be 
readable by all

I ran through the phpMyAdmin scripts and watched it up until it tried to 
load the file, and it wouldn't read it.  The /tmp directory is 
drwxrwxrwx and the files in it are -rw--, but I don't know how 
to get those changed in PHP.  Anyway, on a different server, I could 
have sworn I got the same problem but the uploaded files in the /tmp 
directory were -rwxrwxrwx.  

Any ideas?

Thanks

David Robley wrote:

In article [EMAIL PROTECTED], [EMAIL PROTECTED] says...

I am getting this error with a new install of PHP4.2.1 and Zend 
Optimizer 1.3.1:

The file '/tmp/phpr4WYQY' must be in the database directory or be 
readable by all

I just updated PHP and the Zend Optimizer, and it had worked previously 
with PHP4.1.2,

Any ideas??


Because you are asking on the db list, I'll guess that you are trying to 
use LOAD DATA INFILE? The file you are trying to load needs to be world 
readable if it isn't in the database directory.

If this isn't the problem, can you be a bit more specific about the 
circumstances in which this error appears?





[PHP-DB] Error Loading File

2002-06-11 Thread Bryan Gintz

I am getting this error with a new install of PHP4.2.1 and Zend 
Optimizer 1.3.1:

The file '/tmp/phpr4WYQY' must be in the database directory or be 
readable by all

I just updated PHP and the Zend Optimizer, and it had worked previously 
with PHP4.1.2,

Any ideas??

Thanks


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




[PHP-DB] products

2001-06-19 Thread bryan

I am pulling some products out of my database (doing some other things to
it), but basically making a big array.

Now, if I want to set my quantity to zero, and remove every instance where 
the $iID is, i should be able to do :

  if($cart[num_items] == 0) {
   
session_unregister('cart');
   
   } else {
  
unset($cart[products][$iID]);
   
  }

If I have one product in the array, it works fine.  If I have two products in the 
array,
it does nothing (except decrements my number of items in the cart).

Could anyone show me another solution to this problem?

thanks so much
bryan




[PHP-DB] wrapped?

2001-04-20 Thread bryan

I have articles in the db, and use a 
wrap = "virtual": on my TEXTAREA
when submitting them.  So, my data is
spaced out as I typed it.

Is there a way to display the 'row' as is?

So I want to get what I actually typed.

I tried an str_replace("   " ,"BR", $text), trying to be 
sneaky and just add breaks, but, that didn't seem to work
too well.

Any suggestions?

thanks
bryan



[ bryan fitch . programmer . [EMAIL PROTECTED] ]






[PHP-DB] forget it

2001-04-20 Thread bryan

I found out that the PRE tag works

sorry for the stupid question


[ bryan fitch . programmer . [EMAIL PROTECTED] ]






[PHP-DB] class method

2001-03-20 Thread bryan

I am really new working with classes.  Some of the ideas I am getting, some I am not.
I wrote this simple little class, with a connection method, and a method to loop 
through the
data.  I am not even sure if my code is write (for the loop), but I am having trouble
displaying the data.  My connection works fine, but my loop is jacked.  Could anyone
suggest or maybe correct a mistake (if you see any)?  Just looking to see if I am 
started in the right direction, or if I have this all bass ackwards.  
I have no clue if this is even possible.  I am looking to create a while loop for 
whatever
query I run, and make each row equal to whatever field I put in.  I have all variables
defined within the scope of my class.

Thanks for your help.
 
Code :

function getdata() {

$this-sql = $query;

$result = mysql_query($query);

$fetch = "mysql_fetch_array";

 while ($row = $fetch($result)) {
 
 $this-field = $row['$this-field'];

 }

 if(!$result) {
 
  $this-error = mysql_error();

 return;
 
}

}

**
End

thanks!!!

[ bryan fitch . programmer . [EMAIL PROTECTED] ]






Re: [PHP-DB] class method

2001-03-20 Thread bryan

Yeah, the var $query is defined to the class.

I did mistype the result, thanks.

I was able to make this bad boy work with placing

$field = $row['row_name'];  // whatever the row is called.

But, if that is the case, why would I need a class?
I am just trying to make it so that I can use the
loop for any query that needs it, and can show any row
when I need it.

I appreciate your help!  Thanks a lot
bryan



- Original Message -
From: "JJeffman" [EMAIL PROTECTED]
To: "db" [EMAIL PROTECTED]
Sent: Tuesday, March 20, 2001 1:46 PM
Subject: Re: [PHP-DB] class method


 I need a little more information to help you.
 Is the $query variable a global one ? Or is it a property of the class (
var
 $query; )  ?
 Why are you assigning the "mysql_fetch_array" function to a variable if
call
 it is easier ?

 You have misplaced the "if $result" statement, the right position, I think
,
 is :

 function getdata() {
 $this-sql = $query;
 $result = mysql_query($query);
 if( $result ) { // Check if $result is valid instead of NOT valid
// $fetch = "mysql_fetch_array";
while ($row = mysql_fetch_array($result)) {
  $this-field = $row['$this-field'];
 }
 }
 else  $this-error = mysql_error();
 return;
 }

 HTH

 Jayme.

 www.conex.com.br/jjeffman/antispam.html

 -Mensagem Original-
 De: bryan [EMAIL PROTECTED]
 Para: db [EMAIL PROTECTED]
 Enviada em: tera-feira, 20 de maro de 2001 16:21
 Assunto: [PHP-DB] class method


 I am really new working with classes.  Some of the ideas I am getting,
some
 I am not.
 I wrote this simple little class, with a connection method, and a method
to
 loop through the
 data.  I am not even sure if my code is write (for the loop), but I am
 having trouble
 displaying the data.  My connection works fine, but my loop is jacked.
 Could anyone
 suggest or maybe correct a mistake (if you see any)?  Just looking to see
if
 I am
 started in the right direction, or if I have this all bass ackwards.
 I have no clue if this is even possible.  I am looking to create a while
 loop for whatever
 query I run, and make each row equal to whatever field I put in.  I have
all
 variables
 defined within the scope of my class.

 Thanks for your help.

 Code :
 
 function getdata() {

 $this-sql = $query;

 $result = mysql_query($query);

 $fetch = "mysql_fetch_array";

  while ($row = $fetch($result)) {

  $this-field = $row['$this-field'];

  }

  if(!$result) {

   $this-error = mysql_error();

  return;

 }

 }

 **
 End

 thanks!!!

 [ bryan fitch . programmer . [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] md5

2001-02-27 Thread bryan

Yeah, i am aware of the 32 byte character string.  As a matter of fact, I
md5 the password on initial
sign-up.  Then just compare it to the regular password.  As for this case, I
am trying to
update the password that is already md5 'd in the database.  The problem is,
I am creating a
random string (with letters and numbers) and making it 10 characters long.
I think md5
has a problem with this, for some reason

Probably just me though.  Thanks for the advice.

bryan


- Original Message -
From: "Joe Brown" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 27, 2001 12:40 PM
Subject: Re: [PHP-DB] md5


 You are aware that md5() generates a 32 byte character string?

 Working on the 10 digit password request, have you alotted enough space in
 your database columns to cater to a 32 byte string (64 for multibyte)?

 BTW: md5 has eaten everything I've thrown at it ;-)

 ""bryan"" [EMAIL PROTECTED] wrote in message
 005801c0a0f1$c5c3cd40$272478cc@bryan">news:005801c0a0f1$c5c3cd40$272478cc@bryan...
 I need some advice on this
 I am creating a random password through a function.

 This creates a random password and updates it in the database.
 The sql query works if I make it :

 $sql = "UPDATE members SET password='$password', verify='$verify' WHERE
 username='$username' ";

 but if I make the code (as below) with the md5, it does not.
 I must be doing something wrong, or it does not like to md5 random things
 or something.  Any Advice?

   for ( $a=0; $a1; $a++)  {

   $password = newpwd( 10 );
   $verify = $password;

   $dbcnx = mysql_connect('localhost', 'bryan', 'fitch');
   mysql_select_db( "playtime" );

   $sql = "UPDATE members SET password=' ".md5($password)." ', verify='
 ".md5($verify)" ' WHERE username='$username' ";





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

2001-01-23 Thread bryan

Hey all...

I have a site where people have to pay for the pictures.  He is a professional 
photographer and does not want
people stealing his work.  When they download and image, they pay for it.  The problem 
with that is, if
I have images named 001.jpg, 002.jpg, people can type that into the URL and get the 
other image without
paying for it.  Is there a way to rename a file once clicked on to download to 
eliminate this from happening?

So, the user clicks on the image, called from the database, have it renamed, and then 
delete it from the database,
so they never see the real filename...

I have thought of other ways to do this, but I was hoping there would be an easier 
way, such as this, to do it.

Thanks for the help!


Bryan Fitch