[PHP] MySQL function in a Table's Column

2001-11-24 Thread Jared Howard

I'm not really sure what I should be looking for in the MySQL manual.  I
basically want to make a column that will do math to other columns, like in
a spreadsheet program.  Is it possible?  And if so, what do I look for?
And if you can give me an example that would be great.


-- 
PHP General 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] Shorten String or encode/decode a string

2001-05-03 Thread Jared Howard

I want to shorten a string that I'll be throwing through the url.  It's not
so much that it's too long, but it's ugly.  What it is, is my query string
that I need to pass through to different pages, i.e. viewing multiple pages.  
Anyway, I was looking at encode and decode features but not really sure
that they could shorten it down significantly.  Now I understand that I
won't be able to use it, but I tried the crypt() function and liked how
small it made it.  The string information doesn't need to be secure in
anyway, just smaller (and look like nothing understandable would be good
also).



-- 
PHP General 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] FORM input type=image ... with a posting value

2001-04-06 Thread Jared Howard

I have a page with multiple form submit buttons that carry different values
to do different functions and such.

form name="bidfile" method=post action="?=$ME?"
input type=submit name="mode" value="Edit Contacts"
input type=submit name="mode" value="Add Products"
input type=text name="something" value="?=$something?"
...
/form

?
switch (nvl($mode)) {
case "Edit Contacts" :
save_changes($HTTP_POST_VARS);
add_contact_info($bid_id);
break;
case "Add Products" :
save_changes($HTTP_POST_VARS);
add_bid_items($bid_id);
break;
...
}
?

Which works great!!  However, I grow tiresome of the typical button "look",
and in my attempt to use an image instead:

input type=image name="mode" value="Edit Contacts" src="contacts.png"

failed.  Is there a way to do this?  I have changed my stylesheet to have
the form inputs and whatnot to view smaller which I like.  But not small
enough in some instances, forcing me to look to other ways, such as an
image.  So as I asked before, is there a way to do this or any other
suggestions?


-- 
PHP General 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] MySQL DISTINCT query

2001-03-21 Thread Jared Howard

I need to retrive all column information from a DISTINCT query.  But so
far, I only can get one column to show by using this:

SELECT DISTINCT my_column FROM my_table;

which then gives me a list of my_column information and is correct, but I
need all information from all columns.  Querying this:

SELECT DISTINCT my_column, my_column2, my_column3, my_column4 FROM my_table;

was my guess at it, but doesn't work how I'd like.


-- 
PHP General 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] firewalls MySQL sessions

2001-02-26 Thread Jared Howard

I'm having trouble establishing MySQL sessions when the client is running
from behind a remote firewall.  (I.e., the MySQL server has a static
internet IP, but the remote client which is accessing, or better said,
attempting to access the MySQL database via PHP in their browser can't seem
to establish a MySQL session.)

Does anybody have any experience with this phenomenon?

Thanks.

Lee Howard


-- 
PHP General 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] object/array with repeating values (WORKS)

2001-02-20 Thread Jared Howard

doff, I knew there had to be a simple answer.  Works great, thanks.

At 02:26 PM 2/21/01 +1300, Simon Garner wrote:
From: "Jared Howard" [EMAIL PROTECTED]

 I'm make an object or an array from the results of a query to my MySQL
 database.  The value returned is entered in options and any repeated
 values are unwanted.  Is there a way to remove them easily?

 eg.
 select
 ? $qid = mysql_query("SELECT this FROM that WHERE here");
while ($r = mysql_fetch_object($qid)) { ?
 option?=$r-this?/option
 ? } ?
 /select

 I was thinking of creating an array before the while, then in the while
add
 each "$r-this" if "(! in_array($arr))".  Then I would have to do another
 while with the option included.  But I'm not really sure how to add
 elements to existing arrays.  And that might not even be the best way.
Any
 iteas?



IMHO: always make the database manipulate the data for you, if it can. It's
usually much faster, and requires less code.

In this case just do:

SELECT DISTINCT this FROM that WHERE here

and you won't get any duplicates. Great huh? :)

Refer to the MySQL manual at http://www.mysql.com/docs/ for more details.


Cheers

Simon Garner


-- 
PHP General 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 General 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] converting a date to a string format

2001-02-13 Thread Jared Howard

date("Ymd", mktime(0,0,0,date("d"),date("m")-14,date("Y")));

At 03:57 PM 2/13/01 -0500, Don wrote:
Does someone have a snippet of code that retrieves today's date,
subtracts 14 days and converts the result to a string in the form
"MMDD"?

If possible, please reply to my email.

Thanks,
Don


-- 
PHP General 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 General 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] Retrieve HTML page

2001-02-01 Thread Jared Howard

I've been looking through the manual but I keep on missing the function or
it doesn't exist.
I need to know if there is a way to get a specified HTML page (as if you
were to go to the page by typing in the url in your browser) and either
turn it into a string or array or something that I would be able to cut up
and use the information that I need.  This way PHP does the work instead of
going to the page yourself.


-- 
PHP General 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] rewriting the browser's url

2001-01-13 Thread Jared Howard

I need to know how to be able to eliminate the querysting portion of the
URL that is displayed on the users browser.  I don't want it possible to
click refresh and reenter in the same querystring that was used previously
(eg. php runs a mysql query of INSERT based on the querystring which only
should be run once no matter how many times they click refresh).


-- 
PHP General 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]