greggustin
Members-
Posts
22 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
greggustin's Achievements
Newbie (1/5)
0
Reputation
-
simple question - after SUBMIT - how do I direct the 'next page?
greggustin replied to greggustin's topic in PHP Coding Help
well - it worked - thanks now - trying to be a 'good member' here but cannot find the "Topic Solved" link referenced in the stickies?? -
simple question - after SUBMIT - how do I direct the 'next page?
greggustin replied to greggustin's topic in PHP Coding Help
wow 2 great replys so fast thanks will try them now -
guess I am having trouble with the "LOCATION" command? ie after I have the user hit submit - it dumps to the 'mail.php page (which is very simple - ie not a full html page) do I have to make the mail.php into a full stylized html? hope not thought I could do a redirect back to the origination page in the website I commented out the location command as it was not working idea?
-
I have a form on my html page for new members to sign up all is well if lucky, some day might get 100 per day do I need "close funtion" at end of php posting page? (it works now without it - but only 1 few per day)
-
I want to preset variables in case users leave certain fields blank in a html form eg $email='myname@mydomain.com'; then php has the following: $Email=$_POST['Email']; echo "Email : ".$Email."<p>"; if the user leaves the field empty, I want it to echo [color=red]Email: myname@mydomain.com[/color] BUT it does this --> [color=red][font=Verdana]Email: [/font][/color] (ie nothing) soooooooooo, am I stuck doing a IF test for each post? that is, if post is empty, then set the variable to the desired default value?
-
small MySQL DB => only three rows (ID, GroupID, title, MSG, etc) The Group ID is unique I have a php file that prints a table based on the fields this php file checks on a time schedule to see if the ID has changed (no change - no display // new ID = new display) easy when I made a NEW post (Insert) to table (ie ID was auto-increment) what "trick" can I do when doing Update? without making the user place a NEW value somewhere?
-
how do I fetch Just the MOST recent Row?
greggustin replied to greggustin's topic in PHP Coding Help
[quote author=AndyB link=topic=106640.msg426659#msg426659 date=1157220789] ASC = ascending order, so the first one would be the [i]lowest[/i] number. [/quote] understood - guess that means the whole array was 'analyzed' [i]BEFORE [/i] it was fetched (ie in the DB)) I would have guess it had to be 'fetched' [i]before [/i]it was analyzed no matter - as long as it us understood -thanks again ps GREAT forum !!!!!!!!!! -
how do I fetch Just the MOST recent Row?
greggustin replied to greggustin's topic in PHP Coding Help
worked !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :-* :-* :-* :-* -
how do I fetch Just the MOST recent Row?
greggustin replied to greggustin's topic in PHP Coding Help
ok will try . . . intuitively - would have guess [b] asc [/b]to pick the highest value? but guess intuition is not always the norm in programming ::) -
how do I fetch Just the MOST recent Row?
greggustin replied to greggustin's topic in PHP Coding Help
well _ tried it still made 2 tables then I changed the [i]order by GroupID ascii[/i] to [i]order by id asci [/i] (thinking GroupID (which is a text string) does not vary between like rows) any other guesses? ps looked up the string => "$row = MySQL_fetch_assoc" seems to return a row, not an array? guess that is good? also I do not understand his suggestion ==> [quote]if that issnt enough you can also limit the amount of information seen. limit 1 or 1 - 3231231323 what ever ok.[/quote] thanks -
I have a small DB (id, groupID, title, MSG , etc) I have 2 forms of input (via html form = Both work as desired) one form does edit any field in GroupID one form does add a new row (can put in any GroupID) [[[1st question - as of now - I have only 3 different GroupID possibilities how do I ensure the user does not have a typo and make a new (ie 4th GroupID) I do no want to use radio or drop down - because I do not want the users to see the 'names' of the other groups]]] 2nd question: here is the hard part (for me) I have a small php page that prints a table using the field values in the DB the ROW it picks is GroupID dependent it works GREAT // Except when there are TWO (2) rows with the SAME GroupID so . . . . how do I just select the row that is MOST recent (ie had highest id# (which is auto increment) and yes, if there are 2 rows with the same GroupID I get 2 tables (only want 1) The value of 'pick1' is determined by a small html radio form with 3 choices (one for each GroupID) I imagine the code to fix this is simple - but I have not deduced it yet thanks [code]<?php include 'loginSTSAlertDB.php'; $like=$_POST['pick1']; $server = MySQL_connect($host, $username, $password) or die(MySQL_error()); $connection = MySQL_select_db($database, $server) or die (MySQL_error()); $result = MySQL_query("SELECT * FROM Alert Where GroupID like '$like' ") ; while($row = MySQL_fetch_array( $result )){ echo " <table border=1 cellspacing=2 cellpadding=2 height=240>"; echo " <tr height=60>"; echo " <td colspan=3>" ; echo " <IMG SRC=$row[Logo]>"; echo " </td>"; echo " </tr>"; echo " <tr>"; echo " <td colspan=3>"; echo " $row[Title]"; echo " </td>"; echo " </tr>"; echo " <tr>"; echo " <td colspan=3>"; echo " $row[MSG]"; echo " </td>"; echo " </tr>"; echo " <tr>"; echo " <td>"; echo " OK"; echo " </td>"; echo " <td>"; echo " <A HREF=\"http://www.".$row[MsgURL]."\" target=_blank>More</A>"; echo " </td>"; echo " <td>"; echo " Later"; echo " </td>"; echo " </tr>"; echo"</table>"; }[/code]
-
tried suggestion both "inline" and via "css class" the row spacing is not as bad as in my example in fact, it looks a bit like the spacing here in this post but I have another section of my web page that has even 'tighter' row spacing that I am trying to emulate
-
everyting is fine but I want to minimize the row height (spacing between rows output) so the output is as TIGHT as if I were using "shift returns" in a single cell I am using styles with padding and margins set to zero eg name amount me 10 him 20 not displayed as now: name amount me 10 him 20
-
how do you order by date if dafe field is a text field?
greggustin replied to greggustin's topic in PHP Coding Help
my further research leads me to belive you cannot ORDER on varchar ok - will research the date_format stuff but am I STUCK with the input of xxxx-xx-xx? duh - these are all 2006 ! ws thinking if inputing the month and day in differnet fieilds :) then sort on day ! :P -
how do you order by date if dafe field is a text field?
greggustin posted a topic in PHP Coding Help
I do not like the forced format of dates xxxx-xx-xx (can this be changed?) so I made the date field = varchar I am the only "forms entry person" for our club and we print out the dues monthly on a php web page in reverse order (of date) eg 10 membername 1 jul 18 11 membername 2 jul 17 15 membername 3 jul 12 12 membername 4 jul 04 ergo = I enter the 'date' field in my html forms as jul 4, etc but the 'order by' does not work as desired hints? ps when I did a sample ["order by" paid] (ie $) it listed them as desired (ie my syntax is ok - just not for the varchar field for date)