Jump to content

overlordofevil

Members
  • Posts

    123
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

overlordofevil's Achievements

Member

Member (2/5)

0

Reputation

  1. I am reading up on exporting data from mysql with php. Everything I find tells me how to get all data so what I am wondering is there a way to set up a script to select specific data and have the system download it to a csv file. To explain I am working on a db with multiple tables all tied together with a user id. What I would like to do is do a search for all users tied to a specific group/department. Take the id and get all the data for that user. As the group/department id is only in one table and the user id is in all of them, i know i can run a query to get the ids I need but how would I run addition queries to get the data from the other table and have them exported to the file. Since the queries would be in a loop going through all the tables with the specific id would it be possible to have the script write to the file and then continue to update.. is that possible? I am sure i can figure this out but I am wondering if anyone else has worked on something like this and has some advice on what to watch out for while programing the script. Any suggestion/advice is appreciated. Thanks Bill
  2. I am reading up on exporting data from mysql with php. Everything I find tells me how to get all data so what I am wondering is there a way to set up a script to select specific data and have the system download it to a csv file. To explain I am working on a db with multiple tables all tied together with a user id. What I would like to do is do a search for all users tied to a specific group/department. Take the id and get all the data for that user. As the group/department id is only in one table and the user id is in all of them, i know i can run a query to get the ids I need but how would I run addition queries to get the data from the other table and have them exported to the file. Since the queries would be in a loop going through all the tables with the specific id would it be possible to have the script write to the file and then continue to update.. is that possible? I am sure i can figure this out but I am wondering if anyone else has worked on something like this and has some advice on what to watch out for while programing the script. Any suggestion/advice is appreciated. Thanks Bill
  3. Thank you both for the feedback and help.. I used the code example to help modify my code and it made things work with no issues. Just one other question.. do special characters like & or % get taken care of by this function or is there another one i need to use. Thanks Bill
  4. cool sounds simple enough. so with the characters being escaped to make them db friendly if I do a query to call the same values and echo them on the screen will they display correctly or will i have the backslash in it.. I appreciate you guys explaining this to me just got confused on it. Thanks again Bill
  5. Hey all, I have a question and its probably a really simple thing to figure out but i am drawing a blank on how to do it. Basically I am trying to use single quotes or special characters when inputting data into my db but i have errors that come up. with the single quotes if I put in a name like de'salla or I use it in a contraction like it's, her's etc it will store in my db but when I try to use the data in another string or query I always get an error with php where it breaks on the single quote and won't continue to process the request. So I have 2 variables $name = De'salla; $reason = "Update for user $name"; When I go to insert the value Reason the query will error out becasue the $name value has a single quote in it. This is the basic issues and I know you might need more info but I am wondering is there a php function out that that i can use to correct this issue. Thanks Bill
  6. blargh..... Thanks for finding that.. I thought I caught all the errors... Hopefully that fixes it.
  7. here is the form code <?php echo "<table border='0'>"; echo "<tr><td align='right'>"; echo "<b>First Name:</b>"; echo "</td><td><p>"; echo "<input type='text' name='firstname' size='20' value='$firstname'>"; echo "<font color=red>*</font></td></tr>"; echo "</td></tr>"; echo "<tr><td align='right'>"; echo "<b>Last Name:</b>"; echo "</td><td><p>"; echo "<input type='text' name='lastname' size='20' value='$lastname'>"; echo "<font color=red>*</font></td></tr>"; echo "</td></tr>"; echo "<tr><td align='right'>"; echo "<b>Street Address:</b>"; echo "</td><td><p>"; echo "<input type='text' name='address1' size='50' value='$address1'>"; echo "</td></tr>"; echo "<tr><td align='right'>"; echo "<b></b>"; echo "</td><td><p>"; echo "<input type='text' name='address2' size='50' value='$address2'>"; echo "</td></tr>"; echo "<tr><td align='right'>"; echo "<b>City:</b>"; echo "</td><td><p>"; echo "<input type='text' name='city' size='30' value='$city'>"; echo "</td></tr>"; echo "<tr><td align='right'>"; echo "<b>State/Province/Territory:</b>"; echo "</td><td><p>"; echo "<input type='text' name='state' size='30' value='$state'>"; echo "</td></tr>"; echo "<tr><td align='right'>"; echo "<b>Zip Code:</b>"; echo "</td><td><p>"; echo "<input type='text' name='zipcode' size='10' value='$zipcode'>"; echo "</td></tr>"; echo "<tr><td align='right'>"; echo "<b>Country:</b>(US or Canada)"; echo "</td><td><p>"; echo "<input type='text' name='country' size='10' value='$country'>"; echo "</td></tr>"; echo "<tr><td align='right'>"; echo "<b>Phone Number:</b>"; echo "</td>"; echo "<td><p>"; echo "<input type='text' name='phone' size='12' value='$phone'>"; echo "</td></tr>"; echo "<tr><td align='right'>"; echo "<b>Email Address:</b>"; echo "</td><td><p>"; echo "<input type='text' name='email' size='30' value='$email'>"; echo "<font color=red>*</font></td></tr>"; echo "</td></tr>"; echo "<tr><td align='right'>"; echo "<b>User Access Level:</b>"; echo "</td><td><p>"; if ($_SESSION['user_rights'] == '2') { echo " <input type='radio' name='access' 'value='1' checked>Player "; } if ($_SESSION['user_rights'] == '3') { echo " <input type='radio' name='access' 'value='1' checked>Player <input type='radio' name='access' 'value='2'>Staff Admin "; } if ($_SESSION['user_rights'] == '4') { echo " <input type='radio' name='access' 'value='1' checked> Player <input type='radio' name='access' 'value='2'> Staff Admin <input type='radio' name='access' 'value='3'> Chapter Owner <input type='radio' name='access' 'value='4l'> Global Admin "; } echo "</td></tr>"; echo "</td></tr>"; echo "</tr></table>\n"; ?> I don't see any problem with the form code but then again this is all a test system so I can work out bugs. As I said Firefox processes everything fine so what is different with IE that could cause 1 variable to not translate over properly. And if it doesn't transfer over why isn't it reading the line I posted above to default to the lowest value to make sure things are added correctly?
  8. I am having an issue with my code and IE. What is happening is this is an add new user script for my site. When their info is added if I am using firefox it works fine but if I am using IE it is not getting the access level like it should and that throws off everything. I think this line is what is causing me the issue. $access = isset($_POST['access']) &&!empty($_POST['access']) ? $_POST['access'] : '1'; I added this in to check to make sure that if the "access" did not transfer over from the form it would default to the lowest level. but for some reason when an admin uses IE it doesn't read this line, so it skips the code and goes on to the next step which throws everything off. Any suggestions on what I can try with IE or any settings i should look at in IE. Thanks Bill
  9. cool thanks for the info I will try that out.
  10. Hello all, I am having a minor issue with my scripts when I have php pull data from mysql. Some times data put into the table have ' or " included in the text. So when php pulls that data and I include the variable I get a php error check the manual message. example: I am working with names the the following names are put in the table John Mike Joshua M'ekal So I am workign with the data and I need to add a note to the system that includes the names so I have something like this. $note = "order was updated for $name"; I then insert this into the table. Everything works just fine until it gets to the last name in the list. Then I get this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ekal')' at line 1 So what I am wondering is there a way to turn the variable into a string so the ' stops kicking out this error anytime I try to insert it into a table? Any info or suggestions would be appreciated. Thanks Bill
  11. Thanks again but it wasn't an issue with my css... grr i had an issue on one of my pages in the html layout so that caused a problem with the layout.... sigh.... i feel silly now... Bill
  12. Thanks for the feedback.. I am using padding not the margin option along with 4 div's so that might explain the issue i am having with IE. Thanks for the info I appreciate it. Bill
  13. converting it over is pretty simple. I had to change my frames to css to help my site out. Are you asking for advise or looking for someone to code it for you? My advice is to use div tags, this is kinda like using frames and allows you to control the size and location but you will have to make sure to include requirements for the different browsers out there. Hope that helps ya Bill
  14. Hello All, I am still pretty new to css and I have a few issues/questions. 1) Do you have to write multiple CSS pages for different browsers or can you write one page that all browser can use. - My pages work fine in Firefox but IE the layout is off. 2) how can you setup a page break with a css page. I have tried to do this and it just isn't working for me. I figure all the issues are probably a mistake in my code so any suggestions on what to look at or a resource that will help teach me what to do properly woudl be appreciated. Thanks Bill
  15. cool thanks for the suggestion.. I think I got it fixed.
×
×
  • 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.