Jump to content

cclark40

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cclark40's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Too easy - I really am a "know-nothing!!" Worked like a dream first time!! Thanks
  2. I assume this is possible in php? I have a page that gives a summary of results from croquet tournaments. http://www.croquetvic.asn.au/associationtournamentscompleted.php Each tournament has a unique identifier "tid". Some of the tournaments have results published in pdf format. I would like to put an IF statement in to provide a link to the pdf if it exists. The pdf filenames will be "tid".pdf and the pdf files will be in a subdirectory called "results"
  3. Cool - that works fine. Previously I had a problem where it kept adding additional slashes each time users updated but it doesn't seem to do that now. Now I just need to work why how my other page works fine without mysql_real_escape_string() !!! THANKS
  4. mchl - won't that put a \ in front of the ' ?
  5. I am rather confused as I have one page that works and this one which appears to be technically the same but will not UPDATE when the update string contains a '. Works fine when the string has no ' in it. I have checked with echo "$clubwhen1update"; and the ' appears in the string that shows there so it is coming through the form OK and picking up the variable but the UPDATE just does nothing - no error message but data not updated. Is there anything I can do to get the UPDATE working to put say Rick O'Shea as a string into the database (I have no escaping problems when displaying the data so would rather avoid using \ in the database and stripslashes. Thanks... $clubwhen1update =$_POST['clubwhen1update']; $query="UPDATE clubs SET clubwhen1='$clubwhen1update' WHERE clubname='$clubnameclicked'";
  6. OK I see. For some reason I couln't see the earlier code snippet ??? Thanks so much - You guys are amazing!!!
  7. So are we simply saying it should read....? $result2 = mysql_query("SELECT id, clubname FROM clubs"); echo "<select name='tournamentvenue2update'><option></option>"; while($club_list2=mysql_fetch_array($result2)) { echo "<option value='.$club_list2[clubname].'>'.$club_list2[clubname].'</option>"; } echo "</select>"; Amazing that it worked at all!!! Thanks guys - I'll try it out later (at work at the moment and this is a home project)
  8. Hi Folks, I have a problem with the script below. It simply populates a dropdown box as part of a larger form with data from a database and sends it to the submit page where it updates the database. The data populates fine but when it sends to the submit page it truncates the data so only the first word of the variable gets sent. Most of the entries are a single word so work fine but a few have 2 or 3 words separated by a space so "Williamstown" is fine but "Horsham Kalimna Park" just becomes "Horsham". Can anyone see what the problem is? $result2 = mysql_query("SELECT id, clubname FROM clubs"); echo "<select name='tournamentvenue2update'><option></option>"; while($club_list2=mysql_fetch_array($result2)) { echo '<option value='.$club_list2[clubname].'>'.$club_list2[clubname].'</option>'; } echo "</select>";
  9. OK I've cracked it by using " in my echo statement and escaping it with \ echo "<input type='text' name='event1third1update' value=\"$event1data[14]\" size='30' maxlength='40'>"; Just a find and replace and away I go - Thanks Guys!!
  10. OK - removing the "mysql_real_escape_string" makes it work OK for uploading data. It now populates the box with Rick o when you go back in to make another update echo "<input type='text' name='event1winnerupdate' value='$event1data[10]' size='30' maxlength='40'>"; I understand that the problem lies in the use of single quotes as it sees value='rick o'shea' hence thinks that quote mark ends the string but how do I get round this because using double quote value="$event1data[10]" confuses the echo "......
  11. I am using $event1winnerupdate =mysql_real_escape_string($_POST['event1winnerupdate']); to define the variables that I then use in $query1="UPDATE tournamentevents SET eventwinner='$event1winnerupdate' WHERE.... " is that what you mean or am I missing something...?
  12. Hi Folks, What I want to do is very simple but I am falling foul of escaping characters... I have some html/php forms where users update data in the database. It all works well until someone tries put in a name like Rick o'shea and then one of two things happen... 1. On a form that is located in the root directory it goes in OK but when they go back to update the form again the textbox should be populated with the current value from the database but it says Rick o' 2. On a form that is located in a password-protected sub-directory it puts Rick o\'shea in and when they go back to update the form again the textbox should be populated with the current value from the database but it says Rick o\ Do I need to do something extra with .htaccess (currently just defines index.php as homepage)? What ? and will it correct the problem for the sub-directory as well as the root? Many Thanks in advance
  13. Hi Folks, I have a problem with the script below. It simply populates a dropdown box as part of a larger form with data from a database and sends it to the submit page where it updates the database. The data populates fine but when it sends to the submit page it truncates the data so only the first word on the entry gets sent. Most of the entries are a single word so work fine but a few have 2 or 3 words separated by a space so "Williamstown" is fine but "Horsham Kalimna Park" just becomes "Horsham". Can anyone see what the problem is? $result2 = mysql_query("SELECT id, clubname FROM clubs"); echo "<select name='tournamentvenue2update'><option></option>"; while($club_list2=mysql_fetch_array($result2)) { echo '<option value='.$club_list2[clubname].'>'.$club_list2[clubname].'</option>'; } echo "</select>";
  14. OK - I've created the tables. At this stage I am only using UPDATE rather than INSERT as my users are all little old ladies who are not very tech-savvy. Letting them with insert could lead to all sorts of mayhem so best to populate the database myself and then just let them modify the data! Presumably this doesn't change much except I need to insert 5 events in the events table for each 1 in the tournament table? Obviously the SELECT statement can exclude the null entries on the display page but all 5 events need to appear on the password protected update page.
  15. Thanks Matt, I am full of the flu at them moment so it will take a while for my partially-functioning brain to digest that but it seems pretty logical on the first look!! Colin
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.