Jump to content

python72

Members
  • Posts

    51
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.lottocomplete.com

Profile Information

  • Gender
    Not Telling

python72's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks for the answer, I thought about that but hoped there is an easier way. It seems that if there is few fields that can have variable number of entries the queries will be very resource and time consuming, am I right or not?
  2. Is there a way to be able to vary number of fields in database? Just to explain I will use an example. Lets say we have table with user details, the table has the following fields: User Name - single value for each user User DOB - single value for each user Kid's Names - this can vary, someone can have one kid, others can have several So I am basically looking for a way to accomodate the varying number of kids names for different users, something like array in programming. What is the proper way to deal with this in mysql? I am new to database and web programming in general so all I can think of right now is to create more than enough fields, like Kid1, Kid2, Kid3 ... Kid20 and when processing read them till null or empty field appear, but I think there should be better way to do it? Thanks for all your help.
  3. I know mysql provides some trigger possibilities but I wonder if I could do something more with it. I would like to trigger command (php file) when certain values are set. Let say I am looking for certain values in my database to match predefined values which would trigger that file to run. I know I can have php file checking values in the database and if these values match to go on with the remainder of the execution or exit after the check if the values don't match but I think that doing it directly from database would be more efficient since I would have to have few cron jobs runned at intervals to make sure I eventually get all the values to match and can execute my action.
  4. Just got back to it, thanks everyone for your responses and all the valuable information. Just couple more questions related to the examples provided. Looking at the code for both jpg and png the image (background) is fixed. Is there a way to adjust the size of background based on the size of text to be saved? Would be nice if both height and width could be adjusted based on number or lines/number of characters per line. I can obviously count that before placing the text on the image. How can the file be renamed and/or saved in different directory? What I think these examples do is basically place text on image and save it under the original name. If I can change the name and/or directory I can use one canvas to produce few different messages which in the end can be displayed as images. Thanks a lot for your time.
  5. Pikachu, Not sure what was the problem but now everything is working ok. The dots show in my website address and it takes the email without a hitch, I guess there is something else causing erratic errors, will have to investigate that before I progress any further. Thanks a lot for all your help.
  6. When I use the following: echo "$yoursite"; The address is displayed properly with dots in it, I guess it has something to do with the emailing, do you have any idea what can cause it? When I try to save email addres in variable I get error message related to @ symbol, how should this be done, I am trying to do the following: $email='webmaster@lottocomplete.com';
  7. Here is the code, when I receive the email the dots in the website address are missing. if(@mysql_query($sql)){ $yoursite = 'www.lottocomplete.com'; $webmaster = 'Webmaster'; $youremail = 'webmaster@lottocomplete.com'; $subject = "You have successfully registered at $yoursite..."; $message = "Dear $previousfname, you are now registered at our web site. To login, simply go to our web page and enter in the following details in the login form: Username: $previoususername Password: $previouspassword Please print this information out and store it for future reference. Thanks, $webmaster"; mail($previousemail, $subject, $message, "From: $yoursite <$youremail>\nX-Mailer:PHP/" . phpversion()); //$urlname = urlencode($$_POST['username']); header("location: www.lottocomplete.com/registered/thankyou.php"); } else{ $errormessage = "Your information was not entered into our database.\n Please check your information and try again."; }
  8. I am trying to store website address in a variable but when I do so the dots in the address are missing. I guess it takes it as string concatenation, for example: $address='www.lottocomplete.com'; will actually give me: wwwlottocompletecom How can I make sure these dots will be preserved? I am also trying to store email address in a variable but I get error, something about @ symbol being in wrong spot, wonder how this can be resolved as well. One more questions relates to the new line issue that I have when I concatenate string, for example if I do the following: $string = "1\n"; $string .= "2\n"; $string .= "3\n"; I would think that each number would be printed on new line but instead it shows up as: 123 What am I doing wrong?
  9. I would like to turn text into jpg image. Basically I would like to grab text data from my data base and encapsulate it into jpg image. I am assuming I will have to take background and place my text on top but have no clue where to start. Could you point me to some info or give me some ideas how to do it and which functions to use? Any help will be greatly appreciated.
  10. I am working on lottery numbers where people can check their winning numbers, etc. I would like to include members area where each user's numbers can be stored and when the user logs in the winning numbers would be highlited, etc. I wonder what would be the best way to accomplish this keeping in mind that different users can play different number of lotteries. Right now I am tracking about 30 lotteries but hopefully this number will grow with time. Each registered user will have unique ID# based on auto increment value assigned at time of registration by MySQL at time of registration. I was thinking to create separate table for each lottery where users would store the numbers thay play along with their ID. When user page is displayed the php would search through each table to see if given user plays given lottery and display the numbers or continue on to next lottery if this user ID does not show up in current lottery table. I wonder if this design would work fine and what suggestions anyone might have to improve it or if it should be done in totally different way to avoid issues.
  11. No but I changed the naming for posting. Anyways it works, it was my other code that caused the issue. Thanks anyways.
  12. I am trying to use the following query with sorting: $query = mysql_query("SELECT * FROM Table WHERE Date LIKE '$PeriodSelected' ORDER BY Date DESC"); $PeriodSelected is basically supposed to get me all results from month selected and it works fine. Now I am trying to add sorting to this query and although I get no errors it does not matter if I use ASC or DESC my results are sorted in the same way. Not sure what I am doing wrong.
  13. Thanks a lot guys for taking your time to help. It works great.
  14. I have table with auto increment value and I would like to select data from that table only for the row with the highest auto increment value. Right now I use mysql_num_rows() but if for some reason one of the rows in the middle was removed the number of records will not be equal the value of the highest number and so far I was not succesfull doing it any other way, I have tried using max() but I can not get it to work, here is the code I have tried: $UpdateStartStopQuery = mysql_query("SELECT * FROM UpdateStartStop WHERE max(ID)");
  15. I see some of the fields in mysql show NULL and some are just empty, wonder what is the difference, is empty field still NULL?
×
×
  • 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.