[PHP] Month loop

2003-06-19 Thread drparker
Is there any way I could loop thru and print all the month names (i.e. January, February)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Month loop

2003-06-19 Thread drparker
that's what I'm looking for - thanks. David Nicholson wrote: Hello, This is a reply to an e-mail that you wrote on Thu, 19 Jun 2003 at 20:58, lines prefixed by '' were originally written by you. Is there any way I could loop thru and print all the month names (i.e. January, February)?

[PHP] page name string

2003-06-16 Thread drparker
I need a really simple function that retrieves the actual page file name from a URL. So, if the URL is http://www.server.com/pagename.php, or if it is http://www.server.com/directory/pagename.php, the function in both cases will return pagename.php. I'm sorry if this is a ridiculously easy

[PHP] checking $_POST variables

2003-03-14 Thread drparker
I'm running this script to make sure all fields are filled in on a form: foreach($_POST as $p) { if(!$p) { header(Location: signup.php?error=3); exit(); } } But I need to exclude one field on the form from being checked - Street2. How could I do this? -- PHP General Mailing List

[PHP] retrieve last n records

2003-03-06 Thread drparker
I need to retrieve the last n records of a table, n will probably be 2 or 3. I know that I can accomplish this by: select * from table order by field DESC Limit n, but i would prefer not to do this way because it interferes with my sorting mechanism on the main page. Is there any other way to do

Re: [PHP] retrieve last n records

2003-03-06 Thread drparker
I see your point, and I'd really like to use Limit in the query. However, what if I want to sort those 5 last records by another field? They're already sorted DESC, so I can't do that. Kevin Stone wrote: - Original Message - From: drparker [EMAIL PROTECTED] To: [EMAIL PROTECTED

[PHP] need apostrophe solution

2003-02-14 Thread drparker
i need to escape all my apostrophes in values submitted to a mySQL database. i know how to do the string replace, but is there a way i can loop thru all the post variables and replace the apostrophes? if so, do i need to refer to my variables like $_POST[$variable] instead of simply $variable

[PHP] Getting a field value

2002-12-15 Thread drparker
I'm adding information with the INSERT command to 2 tables. In the first table, called courses, I have a field called course_id that is an auto-increment - assigned by the table. In the second table, called par, I have a field also called course_id. I need to assign to this field the value

[PHP] Re: arrays

2002-12-15 Thread drparker
this should work: for ($i=0; $i5; $i++) { $mypics[$i] = $picture; } Edward Peloke wrote: Ok, very basic question, how do I am going through a loop 5 times, each time, I want to store a value into an array, do I simply set the value of $picture=array($mypics); and each time it loops it

[PHP] returning unique values in columns

2002-11-14 Thread drparker
Is there any way to run a query in mysql that retuns unique values in a column? For example, say i had this colum: Column: - Fashion - Basics - Fashion - Plus Plus - but I only want it to return unique values - in this case I would only want

[PHP] Ordering a text field

2002-11-14 Thread drparker
I'm running a mysql query with the ORDER BY clause, the problem is that the column that I'm running them on is type tinytext. The data are product numbers, most of which are numbers, but some are like 404R or whatever else. So if my values are 403, 404R,405, 4150 - the order ends up being: 403

[PHP] Converting variables to integer

2002-11-06 Thread drparker
I have a bunch of form variables that I need to process as integers. The problem is that some users are writing in values with commas - e.g. 100,000, and that isn't read as an integer. There's more than one variable so I don't want to have to do a string replace for each one. Is there a general

[PHP] uploading an image in binary

2002-11-05 Thread drparker
I'm having trouble with a script to upload images, which is baffling me because a similar script has worked fine on other occasions. I can get the image file uploaded to the correct directory, but it is uploading in ASCII and I obviously need it in binary. The file name on the form is like this:

[PHP] mySQL question

2002-09-26 Thread drparker
I'm just starting to use PHP with mySQL, and I have a few basic questions. I've successfully created a mySQL database on my local machine, was able to create tables and populate them (from the command line), query it with php from the browser, etc - no problems there. Now I need to create one

Re: [PHP] MySQL vs. basic text file

2002-09-24 Thread drparker
ok - thanks for all the replies. it looks like there are no real drawbacks and plently of advantages in using MySQL instead of text files, so i'll do the next project with it. one more question - is there a concrete file that has the database in mySQL? like a file that I could download and

[PHP] rewriting a line in a text file

2002-09-12 Thread drparker
hi - i have a text file that i am using as a database. the format for each line is such (2 lines shown): Fashion|508|Text Text Text.|http://qtbras.com/qtbrascat/images/508_big.jpg|http://qtbras.com/qtbrascat/images/508_thumb.jpg Fashion|510|Text Text