[PHP] PHP/MySQL Interaction

2002-12-12 Thread David Freeman
Hi All This is probably off-topic here and my only real excuse is that after having searched google as well as both php and mysql sites/manuals I'm no closer to an answer for something I'd like to get solved this morning... I have two database tables (mysql). One contains information about image

RE: [PHP] Date fields

2002-12-28 Thread David Freeman
G'day Peter > I have a form with several date fields. I want to be able to > set these by selecting from a calendar display. Does anyone > know of any php function or code which would let me do this? If you mean having some sort of pop-up calendar display that the user can select a date from

RE: [PHP] Running PHP on Windows OS

2002-12-31 Thread David Freeman
> So, there is something in the new security of XP and Win 2K > SP 3 that > does not let the dll load and run. Ever since I loaded SP 3 > I have had > problems - like many others! Don't know about Win2k as I haven't tried it but Apache/PHP/MySQL is working perfectly well on my Win XP laptop

RE: [PHP] Re: PHP and MySQL bug

2003-01-05 Thread David Freeman
> @MYSQL_QUERY("UPDATE d SET h='$h' WHERE id='$id'"); // this > query doesn't work Personally, I'd call it bad programming practice to do a database update and not check to see if it worked or not. In this case, how are you determining that the query did not work? Are you manually checkin

RE: [PHP] array help please

2003-01-05 Thread David Freeman
> $mysql query1 > result > array[cityid][cityname] > > mysql query2 > result > array[cityid][cityname] > > now what i want to do is kick out any doubles in my array > and resort them alphebetically by cityname ?! It's difficult to answer this question without knowing more about the cont

RE: [PHP] Months of the year

2003-01-06 Thread David Freeman
> How do I create a drop down list that automatically > generates a list of months for the next 12 months upto and including this month This would do it... $month_name\n"; } else { echo " $month_name\n"; } } ?> -- PHP General Mailing List (http://www.php.net/) To unsubs

RE: [PHP] Deleting rows from a table with autoincrement. . .

2003-01-10 Thread David Freeman
> My question is this: is it possible to use > autoincrement to generate > the id's and still keep them sequential when I delete say, > item 3 of 5. Generally speaking, an auto-increment column will not fill gaps and keep sequential orders. Your choice, basically, is to write your code

RE: [PHP] forms

2003-01-13 Thread David Freeman
G'day CJ > This is really a html more than a php question. Yep, it probably is... > Is it possible to have two buttons and have different > actions for each button in the same form? Yep, you can. When you process your form in php you'll find that you have either $first_submit_act

RE: [PHP] Which country?

2003-01-20 Thread David Freeman
> Is there a way to get to know from which country a user is > calling the webside with my php-script? Probably only if you're going to ask them to tell you what country they are in. You can look at the resolved domain that they are coming from and it's country code - this might be indicative

RE: [PHP] Which country?

2003-01-20 Thread David Freeman
> You could rely somewhat of the time zone codes as you refer > to them, the > only issue is in some parts of the world > this would include 10 countries at a time. But what time zone are you getting? The time zone of the browser? The time zone of the proxy cache that's in a possibly differ

RE: [PHP] $_POST vars problem

2003-01-20 Thread David Freeman
> On another note, I have found that if I include (and use) > the submit button > everything works perfectly, HOWEVER if I just enter data and > hit return then it messes up. You could try including a hidden submit field like this: For name="submit" change that to whatever name your norm

RE: [PHP] Time code!!!

2003-01-20 Thread David Freeman
Hi Karl First up, would you mind posting your messages in plain text instead of html format? It's just a courtesy to the rest of us. > does anyone have the code to where i can have the time > printed on my home page like for example > > Monday, January 19, 2003 Sure, check out the date() fu

RE: [PHP] A way to break up the string????

2003-01-29 Thread David Freeman
G'day Scott > Just curious, is there a PHP function that will break up the > string for us? I'm not specifically having a go at you but more observing that some people use this list as a first line of question rather than doing some work themselves. Assuming that I didn't already know what fu

RE: [PHP] if (a == b) ...

2003-01-29 Thread David Freeman
> I have a conditional: > if (a == b) > > a is the number 0, but b is a string "Friday August 22". > > The condition is evaluating as true, which is not what I want. > What am I misunderstanding? You're comparing a string to a number perhaps? I tried this: -8<- $a = 0; $b = "Frid

RE: [PHP] using tags with php

2003-02-01 Thread David Freeman
> i want to set up a form that will load values from a table > and make them the > "value" of the edit box... then when people press an update > button then all > of the stuff that changes from the record already in the table gets > changed... anybody know how to make it where you can get th

RE: [PHP] using tags with php

2003-02-01 Thread David Freeman
> i am having a problem using tags by using current > values kept in a mysql table. how do you get the values out of the table and > into a form so they show as the value= part of the tag? Start by making a basic test: "; ?> or you could try this: Either should work. Rinse and repe

FW: [PHP] help with script!!!

2003-02-02 Thread David Freeman
> echo("| %s | %s | %s | %s | %s |", $array[id], > $array[username], > $array[password], $array[status], $array[notes]); If you look at http://www.php.net/echo you'll see that echo does not support this syntax. If you want to use this syntax then you should probably be using some form of print

RE: [PHP] question

2003-02-02 Thread David Freeman
Karl, > what is a winmail.dat file? Is it too much to ask that you do some of this sort of thing for yourself? Here, I'll help you... 1. Connect to the Internet (if necessary) 2. Load a web browser 3. Navigate to http://www.google.com/ 4. Type "what is a winmail.dat file" into the search b

RE: [PHP] File upload???

2003-02-11 Thread David Freeman
> Can anybody help me with file uploading, again... Have you tried using the fairly simple example that is given at http://www.php.net/manual/en/features.file-upload.php yet? I've found that starting with this example and then adding all the extras tends to work well when you've got problems.

RE: [PHP] restricting access to files using PHP

2003-02-12 Thread David Freeman
> i've written a secure PHP login script which will allow > users to login to a > directory such as this: > > smezone.com/members/index.php > > however, how do I restrict people from accessing HTML files in that > directory (which they can easily do so by typing the URL into their > brows

RE: [PHP] recursion?????

2003-02-14 Thread David Freeman
> What I want to do is have the registration form, on submit, check the > data validity right then, if there is an error, redisplay > the form with an * next to the field that is incorrect. This is the code logic rather than the actual working code: ---Start of PHP Page--- 1. Check for form h

RE: [PHP] Date formating

2003-02-15 Thread David Freeman
> I have a string in this format: > 2003-02-15 13:19:02 > > I want to display it in a more readable format like > Staurday, 11 Februardy, > 2003, 13:19:02. How can I achieve that. I tried date() > function but could > not get what I wanted. The date format above is a standard mysql date/t

RE: [PHP] Re: recursion?????

2003-02-15 Thread David Freeman
> as a general rule of thumb, try to do as much > checking as you can with > JavaScript. For those checks such as "is the field a valid > date", "is > the field numeric" and so on, it is much faster to check on > the client, > than to send the data back to the server and check

RE: [PHP] Another Logging Question

2003-02-23 Thread David Freeman
> Right now, it's logging the client's IP, the page that > they're viewing, > the page that they came from, the time of the visit, and their system > and browser info. Ummm, you do understand that, for Apache at least, all of this information can be made available through it's logging? You a

RE: [PHP] Locality from URL

2003-02-23 Thread David Freeman
> Does anyone know of an intelligent way to establish a user's location > (roughly) from either IP address or some other variable > available to the > server from the browser? (Other than polling the user) Not really - the problems you face are: 1. Processing Delays - if you need to do who

RE: [PHP] Populate var with function output string?

2003-03-03 Thread David Freeman
> *** > function write_string(count) { > > for ($x = 0; $x < $count; $x++) { > > echo " Row $x"; > > } > > } > > $my_string = write_string(5); > > echo $my_string; > *** 8<-Untested Code-8<- f

RE: [PHP] redirecting after login

2002-07-23 Thread David Freeman
> what doesn't work is after they login to Page 1, the > redirect sends them to > Page 2 and right back to Page 1 because the global session > isn't staying > registered. Are you putting session_start() at the top of each page where you want to be able to use the session stuff you've set

RE: [PHP] datetime field - still a newbie

2002-07-24 Thread David Freeman
> I have a datetime field in one of my mysql tables...when > displaying some of > my records I want to display the date in the aforementioned > datetime field, > but if the date is today I want to display "today" instead. > If the date is > yesterday I want it to display that so I

RE: [PHP] Paying Job...

2002-07-25 Thread David Freeman
> Do you charge by the page, script or by the hour (that would > be nice). We do this sort of thing in, basically, one of three ways... 1. Client gives us a budget and we give them a clear idea of what that budget will get them. 2. Client gives us a good idea of what they want to achieve

RE: [PHP] RTRIM() - Won't accept 2nd Param

2002-07-27 Thread David Freeman
> When I issue this command to remove any commas at end of string: > > $query = rtrim($query, ","); > > PHP give me an error saying "Wrong parameter count for > rtrim()". How can > this be? The online manual shows rtrim can accept two > parameters. Shouldn't > this work? I have PH

RE: [PHP] Re: Public Scripts in a commercial product

2002-07-29 Thread David Freeman
> Yes, I am afraid that regarding GPL I have to agree with > Microsoft when they say it is a cancer. The problem is that if you want to > distribute something that incorporates GPL licensed components, your > software also needs to be distributed as GPL and so it gets contaminated. > Thi

RE: [PHP] Resetting ID

2002-07-29 Thread David Freeman
> What i want to do is delete the entire IDs and > generate them again so that they are in one single > order like 1,2,3,4,5... .like this. I suspect that if your table, as you use it, needs this ordering then you've got something wrong. It really shouldn't matter much what the internal IDs

RE: [PHP] MySQL password()

2002-07-29 Thread David Freeman
> Mmm.. think you misinterpreted my question... > > > http://www.mysql.com/doc/M/i/Miscellaneous_functions.html > > PASSWORD(str) > how do you unPASSWORD(str) in PHP? Basically, you don't. Instead, what you do is use the password that was provided as user input. You create a suitable

RE: [PHP] fullname

2002-07-29 Thread David Freeman
> is there some other easyer way to do in one line than this?: > > $fullname = $session["f_name"]; > $fullname .= " "; > $fullname .= $session["l_name"]; $fullname = $session["f_name"] . " " . $session["l_name"]; CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsub

RE: [PHP] Vars passed via URL disappearing

2002-08-02 Thread David Freeman
> I just upgraded to PHP 4.2.2 and am trying to make my sites work with > register_globals turned OFF. I notice, however, that with > register_globals turned off any variables I pass via the URL don't seem to be > recognized by the script it was passed to. > I thought register_globals onl

RE: [PHP] Re: Protect PHP coding

2002-08-04 Thread David Freeman
I know I shouldn't do more to keep this going but I'll make this one, and only, post. > this all started when rasmus had a problem with the "click" > in my original post >From what I read, Rasmus made a correction to your opinion. You are entitled to your opinion, but perhaps you should lear

RE: [PHP] Converting datestamp to text?

2002-08-10 Thread David Freeman
> In my MySQL db I have a date-field on every entry looking like this : > 2002-08-10 > When presented on a PHP page, I want it converted to > "Saturday, Augusth > 10th, 2002". > > How do I achieve that? I've been playing around with the > date-command and > strtotime-command but haven

RE: [PHP] Tried that..

2002-08-10 Thread David Freeman
> I've tried that, but as usual rtfm doesn't help me. I need > concise examples > :( > > How would I write this basic select query to get the date in > my format > (Saturday, August 10th, 2002)? > SELECT datum FROM news_items > (where "datum" is the date-stamp in "-MM-DD" format)

RE: [PHP] Re: Pictures and sound in MySQL and access via PHP

2002-08-11 Thread David Freeman
> How do you make a link in MySQL? > > I tried following code were the field "geluid" contains a > link to a mp3 > while ($row=mysql_fetch_array($result)) > { > echo ""; > echo $row[woord_nl]. "" > . $row[woord_ost]. "" > . $row[betekenis_nl]. "" > . $row[geluid]; > echo ""; > }

RE: [PHP] Whois...

2002-08-12 Thread David Freeman
> I'd like to implement on my web site an "whois" to know the > information about a domain name (.com, org, ) There's an article about doing exactly this on devshed (www.devshed.com/Server_Side/PHP/) that you could have a look at. Looked like a pretty complete solution when I went looking

RE: [PHP] assoc array question

2002-08-15 Thread David Freeman
> while (list ($key, $val) = each ($info)) > { >do stuff > } $count = 0; $last = sizeof($info); While (list($key, $val) = each($info)) { if ($count == 0) { // first time through } if ($count == $last) { // last time through } // do stuff $count++; } -- P

RE: [PHP] Undefined variable: PHP_SELF

2002-08-15 Thread David Freeman
> I keep getting "Undefined variable: PHP_SELF" when using the > following: > > > > Global variables are off... What am I doing wrong? In current versions of PHP, $PHP_SELF is available if globals are on. You'll need $_SERVER['PHP_SELF'] instead if you're keeping globals off. CYA, Dav

RE: [PHP] php/shell/permissions problems....

2002-08-19 Thread David Freeman
> I've got a php form, that gathers certain information, and > then passes that info on to a couple of shell scripts to > move files around, create links, import data into some mysql > databases via sql files, etc. > > The two shell scripts work fine when I'm logged in as root > via t

RE: [PHP] database value count retrieval

2002-08-19 Thread David Freeman
> >SELECT COUNT(x) FROM table; > > > >Make 'x' equal to any column name in the table and add WHERE to the > >clause as needed. > > err...all very well, but how do i retrieve the > value afterwards? > $sqlcom="select count(codigo) from comments where > codigo=$id";

RE: [PHP] Can someone - anyone see my error?

2002-08-25 Thread David Freeman
> And here is the error I get: > - > Warning: Unable to create > '/home/thehobby/public_html/php/phpforums/uploads/': Is a Does this directory exist? Does the user that your web server is running as have permission to write files in this directory? >

RE: [PHP] Date conversion problems

2002-08-26 Thread David Freeman
> I have, in my database, a bunch of dates stored like this: > -M. Month is obviously the number of the month (5), not > the name (May). > > I want to convert the format to MMM, (ex: May, 2002), Do the conversion in MySQL - it'll save you grief in the long run... SELECT DATE_F

RE: [PHP] Average Number For Math Functions

2002-08-29 Thread David Freeman
> Ok so how do I sum up an entire column in my db? > For example if one row is : 1 , the next is 2, and the next > is 1 - I need to > have a total of 4 and the be able to divide by the num_rows > > The problem I ma having is the "inside" row addition If you're doing it on values from a d

RE: [PHP] Returning Rows Question

2002-09-04 Thread David Freeman
> How do you alternate colors of the rows in a table inside a > while statement > when dealing with the output of data from a DB. I am sure > it's something > simple but I keep getting into some really long math thing... For two alternating colours I normally do something like this: $use

RE: [PHP] QUery success, but blank results/variables

2002-09-09 Thread David Freeman
If you've typed your code in accurately then... > $detailqry = "SELECT id, parentitemid, itemtypeid, itemstatusid, [etc] > $result = mysql_query($detailqry) or die("Failed finding > task details"); somewhere in about here you want to have something like: $sqldata = mysql_fetch_array($res

RE: [PHP] Help getting count to show up.

2002-09-10 Thread David Freeman
> ex. SELECT feild1, field2, COUNT(*) FROM tables GROUP BY > category, format. Try this instead: SELECT field1, field2, COUNT(*) AS field3 FROM TABLS GROUP BY category,format Now you'll find your count is available as 'field3'. CYA, Dave -- PHP General Mailing List (http://www.php.n

RE: [PHP] Re: unless something...

2002-09-12 Thread David Freeman
Doing stuff with || is always a good way to stuff up. In the case of your example it will always evaluate to true. > if ($A != $C || $B != $C) { > > I think, but im fairly new This would work if you did this: If (!($A == $C || $B == $C)) { > > In perl, I would do this: > > > > unless (

RE: [PHP] Need some help please.

2002-09-18 Thread David Freeman
> I am having trouble with a PHP script. I am not the one who > made this and my knowledge on php is very little. > I came across this php script > www.canberra-wx.com/bomonster/bomonster01.php Tried loading this and had too many page errors to figure out what you are doing. > www.canber

RE: [PHP] Need some help please.

2002-09-18 Thread David Freeman
> Thats a Nice feaure you have, How do you do that? I have a cron event on my server that grabs the relevant page from the web site soon after it is updated (around 20 past each hour) using "lynx -dump url" which then pipes the resulting page dump through grep to grab just the line of data that

RE: [PHP] Update identical table

2002-09-29 Thread David Freeman
> I have 2 identical tables called "tmp_data" and "data". (on > the same mysql database). > What would be the simple and more convenient way to update > table "data" with a row from table "tmp_data". What about getting rid of "tmp_data" completely and adding an extra column to your "data"

RE: [PHP] Quick question.

2002-10-02 Thread David Freeman
> I am the webmaster of the site, i pay for the server space, > is that what you mean? First up Simon, I deleted over a hundred lines of no longer relevant content from your message including things like signatures. You should probably trim messages down when you reply to them... Next up, w

RE: [PHP] need help for a where clause

2002-10-06 Thread David Freeman
> I need a where clause in following situation: > > Say I want to query two tables: A and B. In table A there is field > Afn, while in table B there are 3 fields: Bfn1, Bfn2 and > Bfn3. I want > to do a query, in which the where clause must do these things: > > if A.Afn=1, then che

RE: [PHP] parsing variables through webpages

2002-10-07 Thread David Freeman
> I send hidden variables from a form to a php. In the php > I have the following code to convert the global vars sent: > > If (isset($_GET['foo'])) > $foo = $_GET['foo'] > else > $foo = 0; > > But this only works using the "GET" method! If you're sending the

RE: [PHP] running slow on Win2k

2002-10-07 Thread David Freeman
> I have no interest in getting into a Win2K/Linux debate. There are > strengths and reasons for using both systems. Good for you, I was about to post something similar. For the record my dev environment is a laptop with a Celeron 1.2/256MB/WinXP Pro and it's running Apache, MySQL and PHP j

RE: [PHP] Function is_readable doesn't work correctly

2002-10-08 Thread David Freeman
> if (is_readable("owner.php")) > echo "READABLE"; > else > echo "UNREADABLE"; > include ("owner.php"); > ?> According to the manual, the results of is_readable() is cached. So, if you've been testing this and have both readable and unreadable you may have the wrong one c

RE: [PHP] Working with dates in PHP

2002-10-10 Thread David Freeman
> I am at my wits end at the moment. I am pulling a > datetimestamp out of a database and attempting to > get the year month and day out of it. Do it in your sql query. Check out chapter 6 of the MySQL manual for ways to manipulate dates. Eg. $query = "select DATE_FORMAT(DTStamp, '%e %b

RE: [PHP] A little help needed, I cant figure!

2002-10-13 Thread David Freeman
> >Song Table: > >Song_id > >A_id > >Type > >Name > >Length > >Lyrics > >... > > > >That's my ideas on how to do it. There are many ways to do > it, though. > > > Totally agree with what John says. If the lyrics are long > (as I assume > they will be) then I'd probably hive the

RE: [PHP] A little help needed, I cant figure!

2002-10-13 Thread David Freeman
> Indeed, another problem I have is that if a single is on an > album, which track it is on the album. Off hand, I'd say that if you need this information as well (ie. You want to recreate the "songs on album" list in the correct order) then you need to extend one of your tables to include th

RE: [PHP] Getting the highest number in a column

2002-10-15 Thread David Freeman
> Using PHP and a MySQL database, I want to grab the highest > number in a particular column. As is usual for questions like this, the answer is most likely that you should do it in your sql query. In this case, something like this would probably do it: SELECT MAX(some_column) FROM some_tab

RE: [PHP] Re: Another odd file problem / Limit on File uploads?

2002-10-15 Thread David Freeman
> post_max_size = 10M > upload_max_filesize = 8M > memory_limit = 8M > > As I said before, however.. even without throwing files > there, my loop > test code only spits out '01234', meaning that its only > looping 5 times > through the code before exiting... Does file handling only

RE: [PHP] File upload and php... not a beginner question...

2002-10-15 Thread David Freeman
> I'm currently working on a big photo album tool, and I want > to provide user > the ability to upload a lot of jpeg files in one time... > The big problem with form is it's too slow... > > Does anyone know how to by-pass this ( with java or other > tools )? It's primarly slow bec

RE: [PHP] $_FILES posting limited to 5?

2002-10-16 Thread David Freeman
> For all those who don't know my question from yesterday, I > have a form where I can upload up to 9 files at a time. > Unfortunately, only the first 5 of those files are being > uploaded at any given time. I haven't specifically checked your program logic but I believe that this is wher

RE: [PHP] Re: $_FILES limited to 5? (Server versions)

2002-10-16 Thread David Freeman
> Just wanted to let everyone know: > > PHP version is 4.2.1 > Apache is 1.3.24 > > Running WindowsXP Pro Oh, yeah, that. My dev environment is almost exactly the same. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] File Upload Problem

2002-10-29 Thread David Freeman
Hi All I'll start by saying that I've checked the online manual (and comments) as well as having done a Google search on this with no success. My problem is that files uploaded through a form are increasing in size. For example, I upload an image that is 7658 bytes and the uploaded version is 768

RE: [PHP] Re: File Upload Problem

2002-10-30 Thread David Freeman
G'day David > > My problem is that files uploaded through a form are > > increasing in size. > Doesn't that look like the EOL characters are being > translated after the fashion of ftp ascii transfers? > Maybe have a look at the two versions in a > hex viewer and see if that is the cas

RE: [PHP] Am I blind? simple 15 line code producing error - SOLUTION FOUND! - tks

2002-11-04 Thread David Freeman
> To those of you that helped me with this problem I have spent time > eliminating lines of code.. the problem was in the following line: > if ($_SESSION["first_name"]) > > the line should be like this > if (ISSET($_SESSION["first_name"])) The change that would induce this error is likely

RE: [PHP] Firewall Question

2002-11-05 Thread David Freeman
> My OS is Windows XP Pro but the computer with admin > privaliges is Windows > 98. It's not software, it's hardware. It's built into the > HUB of the LAN. > There is some software to open ports but I'm not sure what > it is or anything > like that. Thanks for the help so far. No offence

RE: [PHP] Query to select every other record

2002-11-17 Thread David Freeman
> Does anybody know of a SELECT QUERY that will select every > other record of a > table ? I want to do this so that I can display my products > in 2 columns (I > will also be using arrays of course). Don't know of a select that'll do it, but then I don't really understand why you'd want

RE: [PHP] MySQL - Creating The Database

2002-06-04 Thread David Freeman
> Sorry if this is an ignorant question, but I want to do one > simple thing - create an empty MySQL-type database to upload > to the server so I can start using PHP to access it... how > can I do this? I don't really want to have to download the > whole MySQL product just to create an e

RE: [PHP] MySQL - Creating The Database

2002-06-04 Thread David Freeman
> Am I correct in saying that none of the SQL functions in PHP > can actually create a database file when no file existed > before? In other words, an empty database file must exist > before SQL functions can be called on it? If you have appropriate access you can. You do need 'root' acc

RE: [PHP] MySQL - Creating The Database

2002-06-04 Thread David Freeman
> Also, if a person doesn't _know_ that PHP can create a > database for you, how would they know that somewhere in the > list of PHP functions is the answer to the problem? It would > be foolish to expect someone to read the _whole_ of the > documentation on MySQL or PHP just to see if t

RE: [PHP] Passing variable to the next page

2002-06-04 Thread David Freeman
> Here is scenario that I am working on but have a problem. > I have 10 thumbnail images on the page with information for > them created from database. > (I am pulling more info about that image from database, but > on this page I only display "Name of Image" and "Author of > image

RE: [PHP] [PLEASE HELP] Passing variable to new page.

2002-06-06 Thread David Freeman
> echo ""; > echo" function pop1() {"; > echo" window.open(\"info.php?prod_id=$result[0]\"); }"; > echo ""; > I am calling this function in the following manner: echo" onclick=\"pop1();\""; OK, I tend not to put javascript inside php echo statements as it confuses things - which variables

RE: [PHP] majordomo in php?

2002-06-06 Thread David Freeman
> Anyone knows of a majordomo type mailing list made with php > somewhere? Why would you want to do that? If you need mailing list software you'd be infinitely better off using one that already exists - if you need features that it doesn't support (eg. A web front-end for majordomo) then per

RE: [PHP] Thumbnail pages - alot of them

2002-06-07 Thread David Freeman
> I have a mysql database table of about 7000 images (they are > not actually in the db, just references), as yet > uncategorized. I need to put them online and allow my > client to browse 12-18 thumbnails per page. > > what would be the most efficient method to code that with > PHP?

RE: [PHP] convertion from string to time & substracting

2002-06-07 Thread David Freeman
> I got a mysql database, where two of the fields of a table > record times as > CHAR(8) in the format hh:mm:ss This is one of those situations where having your database using the most appropriate field types would help. When you've got it as CHAR there's little you can do in the way of co

RE: [PHP] majordomo in php?

2002-06-07 Thread David Freeman
> > > Anyone knows of a majordomo type mailing list made with php > > > Why would you want to do that? If you need mailing list software > > you'd be infinitely better off using one that already exists - if you > > need features that it doesn't support (eg. A web front-end for > > ma

RE: [PHP] strip_tags bug ?

2002-06-07 Thread David Freeman
> The minor problem is that it treats a "not-equals" sign, > "<>", as an empty tag and strips it, unless it's explicitely ...etc... Except, of course, that when writing html you are supposed to use entities for any valid html stuff - ie. Use > and $lt; for > < and so on. As you should also

RE: [PHP] dynamic pull-down menus?

2002-06-07 Thread David Freeman
> That sounds very close to what I'm trying to do. Is it > necessary to reload the page every time a selection is made? I've found examples of the javascript side of it on www.irt.org that helped last time I did this sort of thing. The php/sql stuff is a matter of figuring out what you nee

RE: [PHP] e-commerce example

2002-06-08 Thread David Freeman
> I'm looking for e-commerce example (PHP+MySQL) so I don't > start from zero and save some time. You could try searching for "php mysql commerce" on any of the following: www.google.com www.freshmeat.net www.hotscripts.com Where you'd probably find what you're looking for. CYA, Dave

RE: [PHP] Re: Date?

2002-06-09 Thread David Freeman
> Speaking of which. I was thinking about this this morning. > Is there a part of the Unix timestamp that tells php what > timezone to > report. You could use the gmt-based date manipulation to do this. > Reason why I ask, is I would like to offset the unix > timestamp relative > to

RE: [PHP] Calendars

2002-06-10 Thread David Freeman
> I am trying to feature a calendar on a web site. I would > like it to display on a page and be able to change to > another month when this is requested and display items for > the general public. I want the client to be able to go into > the database and update the items and those item

RE: [PHP] the curse of the period

2002-06-11 Thread David Freeman
> The directory and file name: > museum/trees/admin/upload2.php > > The directory I want to store the uploaded file is: > museum/landmark/photos/ I've found that if you need more control over directory paths than something fairly simple then you're often best off just declaring a s

RE: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread David Freeman
> I do beg your pardon... But does PHP not have GOTO command? Why do you need one? In my experience, going right back to BASIC over 10 years ago, it's rarely _necessary_ to have a goto. In php I suspect you'd get similar functionlity out of either include() for creating functions. Not using

RE: [PHP] Include question

2002-06-11 Thread David Freeman
> somefile.php > $apple = 'green'; > $pear = 'yellow'; > ?> > > callfile.php > include 'somefile.php'; > echo "Apples are $apple and Pears are $pear"; \\ which would > return the > line with green and yellow in the correct spots. > ?> > > But when I just do > > include 'som

RE: [PHP] Else/For loop

2002-06-12 Thread David Freeman
> Being relatively new to php, I discovered the following > after about 2 hours of debugging last night and was wondering why??? > > I had the following code: > > if ( $num_results = 0 ) > { > echo "no records found"; > } > else > { > for ($i=0; $i < $num_results; $i++)

RE: [PHP] Querying for MAX

2002-06-12 Thread David Freeman
> What I’m trying to do here is not inside PHP nor MySQL books > I have. I need to query the DB to look the max result in a > column. That is, if I have affiliate members with ID going > from 1 to 10, get the query to know that the last member > added was 10 so I can add member 11 witho

RE: [PHP] Extracting from an Array

2002-06-12 Thread David Freeman
> I have a db field, type varchar, that is actually a 'date' > string formatted as dd-mm-. I used type 'varchar' (rather than > type 'date') since I had to accomplish other things with it. > Now, however, I do need to extract the Year (the last four > digits in the array). Ummm, are

RE: [PHP] possible to add a "record number" to a query?

2002-06-13 Thread David Freeman
> I would like to have a column returned in a query that tells > you which record I'm looking at? Sort of like an > auto_increment? IOW, the query results would look like: > > record first last > > 1 johndoe > 2 joe blow > 3 carol fisher > > Th

RE: [PHP] truncating dilema

2002-06-13 Thread David Freeman
> It has just occured to me though that if I'm to list maybe > 100 news items with descriptions it means alot of memory > right because i have 100 items containing: > date > title > text (could be any length) > > I will use su

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

2002-06-13 Thread David Freeman
> I have a JavaScript function that onChange of a list box, > takes the value of an option and grabs data from a MySQL > table. My problem is how do I use the JavaScript var in my > sql statement? Javascript is client-side, php is server-side. The only way to get something that happens i

RE: [PHP] string to array?

2002-06-13 Thread David Freeman
> I have a string something like "10.2.3" > I want to be able to use the "." as a delimiter to reference > the elements (10, 2, and 3). > My thought was to create an array, using "." as the > delimiter. Is there a function that will create an array out > of a string, using a delimiter y

RE: [PHP] Extracting Variables

2002-06-13 Thread David Freeman
> echo "i = $i"; > for($c=1;$c<=$i;$c++){ > echo "team_number $team_number_$c"; > echo "sub1_$c = $sub1_$c"; > echo "sub2_$c = $sub2_$c"; > echo "sub3_$c = $sub3_$c"; > echo "sub4_$c = $sub4_$c"; > echo "sub5_$c = $sub5_$c"; > } > } Perhaps this: Ech

RE: [PHP] mysql_num_rows always returns 1?

2002-06-18 Thread David Freeman
> $query = "select count(*) from users where " You are asking for a count() in your query. This will always give you one row returned with a count. If you really want to do this you should probably have: $query = "select count(*) as usercount from users where" Then you can do your te

RE: [PHP] insert date with a calendar

2002-06-20 Thread David Freeman
> user input, which is not always reliable, has to be in the correct format. What I've done for things like this is to have three separate select form elements. The first for selecting a day of the month. The second for selecting a month and the third for selecting a year. I usually set the

RE: [PHP] include() question...

2002-06-20 Thread David Freeman
> Okay, let's say I want to send a user to a certain webpage... > > usually I would use... > > include("website.php"); > > but, if i want to send a user to a website along with a > variable like... > > $temp = "website.php?var=".$var; > include($temp); > > ...this doesn't work.

  1   2   3   >