Jump to content

JDawg

Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by JDawg

  1. I made a mysql table that held a location name, address, city, state, and a picture for that location. In my Image column in the table I just stored the pathname to the picture I wanted. Storing the actual photo in mysql is possible but it bloats the table. I stored my pictures under images/location on my webhoster\'s server. So say for location #1 I would just store the pathname images/location/picture1.gif in the image column. Location #2 pathname = images/location/picture2.gif and so forth. Hope this helps. JDawg
  2. I am working on a website in which I want to allow clients the ability to login and see there audio scripts. I also want them to be able to modify there script online. So the form will need to be able to read and write to a mysql table. How I would like it to work is this way? 1. Client logs in, which will bring up there script for them to view. 2. They lookover there script, make any changes they want to, and click submit. 3. Later they think of some more changes, log back in and make the changes. Here I am thinking I need a date or a timestamp. Now, here is where I am unsure what to do exactly. Some clients, change there scripts weekly, others monthly, and some less frequently than that. As new scripts are written for each client, I will want to keep copies of the old scripts. Some clients I will want to keep copies of the latest 3 scripts they ran, and others I may only want to keep a copy of one script. What would be the best way of going about accomplishing this? Much appreciation to anyone who has any ideas. Thanks! JDawg
  3. Are you running MySQL on your own computer, or are you accessing your MySQL through something like Phpmyadmin? What type of publishing program are wanting to export your table into? I know there are some tools that will let you export from MySQL into MS Access. From there you could do a mail merge with Word for your mailing labels JDawg
  4. I just wanted to let you know that I figured out my problem. Thanks for taking the time to help me.
  5. I will try to explain it in detail. I am not trying to insult your intelligence, I just don\'t want to leave anything out. Hope this makes sense. Thanks for your help. I am trying to build a store locator database. I have a table that holds the storename, address, city, state, zipcode, relatedzip, relatedzip2, and relatedzip3. When someone types in the zipcode they live in, it first trys to find a match in the zipcode field. If it finds a match it displays the pertinent information for that store. I have relatedzip, relatedzip2, and relatedzip3, because even though a store may not be in the zipcode that the person typed in, they could actually be closer to a store that wasn\'t in there zipcode, than to one that was actually in there zipcode. The zipcodes I have in the relatedzip, relatedzip2, and relatedzip3 all relate to an actual store. So for instance, say someone typed in zipcode 55555. First I selected all from the table where that 55555 matched up with the zipcode field. If there was a match, I displayed the pertinent store data. Then I want to check and see if relatedzip, relatedzip2, and relatedzip3 have zipcodes in them. So for instance, say that row that matched up with 55555, had 66666 in the relatedzip field. I wrote this select statement: $sql = \"SELECT * FROM tbl_stores WHERE $relatedzip = zipcode\"; to check for that. It takes 66666 and searches for a match in the zipcode field, and then displays the data for that store. So what I want to happen is, if relatedzip, relatedzip2, and relatedzip3 all have zipcodes in them, I want to display those results as well. What is happening is, it takes the zipcode they entered, finds a match in the zipcode field, and displays the data. Then it sees if there is anything in relatedzip, if there is, it displays it. Then it looks in relatedzip2, and if there is something in there it is supposed to display it. Well it doesn\'t, unless I comment out the code for relatedzip, then it will display the data for relatedzip2. Once again, sorry for the length of my reply. I really appreciate your help. JDawg
  6. Thanks for the conformation on the mysql_free_results. I wasn\'t sure if I was even using it in the right place. I would post my code, but there is a ton of it in the script. That could be the problem, I could be doing things the hard way. Basically, what I am doing is this. 1. I have a select statement: $sql = \"SELECT * FROM tbl_stores WHERE zipcode = \'\".$zipcode.\"\'\"; 2. Then I have this code: $result = mysql_query($sql,$dbcnx); while ($row = mysql_fetch_row($result)) { 3. Then I set all the $row[#] equal to a variable. Then I echo all the data I want to show Then I have another select statement $sql = \"SELECT * FROM tbl_stores WHERE $relatedzip = zipcode\"; $relatedzip is a variable I set to equal a certain $row[#] earlier in the script. Then I have this code again. $result = mysql_query($sql,$dbcnx); while ($row = mysql_fetch_row($result)) { Then I set the $row[#] = to variables again, and echo the new results. Now I may be doing this the wrong way, but it is the only way I could think of doing it. I write the all of the red code two more times, only I use different variable each time in the select statement, so it pulls different data. When I try to echo the results it gives me a Warning: Supplied argument is not a valid MySQL result resource. I can comment out the first section of red code and the second set of red code will echo the results. Or I can comment out the first two sections of red code and the third section works. I apologize for the length of this reply. Again, any help is greatly appreciated. I realize there could be a much better way of doing it, so please feel free to restructure the way I am doing it. Thanks, JDawg
  7. I hope this question makes sense. Does mysql_fetch_row function have a limit on how many subsequent times in can be used in a script? I have a script in which I use the mysql_fetch_row function several times throughout the script. The first and second times I use it, it returns the results perfectly. But it gives me this: Warning: Supplied argument is not a valid MySQL result resource, on the third and fourth time I try using that function. I tried using mysql_free_result because I have mysql_fetch_row($result). This hasn\'t helped, and it may not even be using it for the right reason. Any help is greatly appreciated. Thanks! JDawg
×
×
  • 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.