Jump to content

leachus2002

Members
  • Posts

    96
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

leachus2002's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi There, I have been reading a tutorial on a website that shows people how to upload files into a MYSQL server - which seems to work perfectly. ** Code Extract ** if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } However, the problem I am faced with is that I would like to use MSSQL as the server to upload to, and I understand that the ADDSLASHES command will not work with MSSQL? I have tried using a combination of ADDSLASHES and str_replace commands, to escape the single quotes - but to no avail I am afraid. Can anyone help by helping me to modify the code above to allow me to upload to my MSSQL DB? Thanks in advance Matt
  2. How easy do you think it might be to incorporate this list: http://jqueryui.com/demos/sortable/#connect-lists with the first link? Thanks Matt
  3. Yes they are - it would just be a case of updating the employee_id field of the table
  4. Hi, Yep - for example, a list would be a queue of work for a member of staff - and I would like to drag from 1 member of staff to another. Cheers Matt
  5. Hi Everyone. I have been looking at this website http://www.webresourcesdepot.com/dynamic-dragn-drop-with-jquery-and-php/ which shows an excellent example of using JQuery and PHP to create, and edit an ordered list. This is great for changing the order of a list - however, I would like to be able to move between several lists - and update a variable called "list_id". Does anyone know if this can be done, and if so, are there any tutorials out there to do this? Thanks Matt
  6. Hey All, Have been looking into this for a week or so now without any luck - any ideas out there? Thanks Matt
  7. Hi Everyone, I have a training package that was developed by one of our departments, and I want to intregrate PHP into it so that it can post results of an exam to a DB. Basically, the way that it get's the score to the screen currently is to store the "score" value into a JS variable, and send it to screen using a <DIV ID='Score'> tag. Is there any way that I can extract the information out of that DIV tag into a PHP variable with just the score? I have tried: $score = '<div id="score"></div>' However, this brings the whole tag into the DB. Help is appreciated Thanks Matt
  8. Hi All, Are there any decent PHP graph solutions out there? I have an SQL statement that returns 12 numberical values in an array (mssql_fetch_array). I would like to plot these values on a graph. Thanks Matt
  9. Hi Ken, That's great, just what I need - however it is giving me the next 5 weeks, rather than the last 5 - is that easy to change? Thanks Matt
  10. Hi Both, Thanks for coming back to me! The complication is that my select box if built using an SQL statement. Like the following: while ($rowvalues=mssql_fetch_array($getnames)){ $name = $rowvalues['forename']; $options.="<option value=\"$name\">.$name."</option>"; }
  11. Hi There, Is there any way that I can get a select box to auto-select the value from a SQL query? For example, if I have a select box like this: Dave,Jon,Simon,Fred And a select statement that brings back the value of Fred then the select box (in HTML) would: <select name='people'><option>Dave</option><option>Jon</option><option>Simon</option><option selected='selected'>Fred</option></select> Same as if the name was Dave, or Simon etc etc. Hope that makes sense? Cheers Matt
  12. Hi Ken, I am not sure where to start - I am happy with dates and all, but not sure how to get just Monday dates etc etc. Cheers Matt
  13. Hi There, I am trying to create a table, and accross the top I would like the Week Commencing Dates of the last 5 weeks. So for example: <table> <tr><td>07/02</td><td>31/01</td><td>24/01</td><td>17/01</td><td>10/01</td></tr> </table> Can anyone help? Cheers Matt
  14. Hi Neil, I would like it to warn at less than 5 days until required_date, and also when the required date has passed. This is how I am using your code: <?php // the number of days from todays date we will add to our range $numdays = 5; $days = array(date('d/m/Y')); for($x = 1; $x <= $numdays; $x++) { $days[] = date('d/m/Y', strtotime('+'.$x.' days')); }// the date value to test $totest = '31/01/2011'; if(in_array($totest, $days)) { $result = '<img src="error.png"/>'; }else { $result = ''}?>
  15. Hi Neil, I have re-coded using your code, and it is working fine - I can see what you mean with the previous code that I used, it was highlighting more than I needed! Is there any way with your code that it can also highlight passed (previous) dates? Thanks Matt
×
×
  • 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.