Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. mysql_query returns a bool, so check that. if (!mysql_query("UPDATE BTECL31113 SET FirstName='$ud_FirstName' , LastName='$ud_LastName' , GroupCode='$ud_GroupCode' , Unit1='$ud_P_Unit1' , Unit2='$ud_P_Unit2' , Unit3='$ud_P_Unit3' , Unit6='$ud_P_Unit6' , Unit14='$ud_P_Unit14' , Unit20='$ud_P_Unit20' , Unit27='$ud_P_Unit27' , Unit28='$ud_P_Unit28' , Unit42='$ud_P_Unit42' , Unit10='$ud_P_Unit10' , Unit11='$ud_P_Unit11' , Unit12='$ud_P_Unit12' , Unit13='$ud_P_Unit13' , Unit1454='$ud_P_Unit1454' , Unit15='$ud_P_Unit15' , Unit16= $ud_P_Unit16' , Unit17='$ud_P_Unit17' , Unit18='$ud_P_Unit18' WHERE P_Id='$ud_P_Id'")) { echo mysql_error(); } ps: Your database design is completely floored. Any time you see fields such as foo1, foo2, foo3, foo4 etc etc screams database normalisation is required.
  2. What does the error say? I didn't test any of the code I posted.
  3. What have you done to debug the issue then? You can trap database error you know? See mysql_error.
  4. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=356187.0
  5. What error are you getting?
  6. Use exec instead and check and give it a $return_var argument.
  7. I should show an example of sending data to php too I guess. index.php <!DOCTYPE html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.js"></script> <script> $(document).ready(function() { $("#linky").click(function() { $.ajax({ url: 'foo.php', type: 'POST', dataType: json, data: { msg_from_js: 'Hello from jQuery' }, success(response) { $('#foo').html(response.msg); } }); }); }); </script> </head> <body> <a href="#" id="linky">Click</a> <div id="foo"></div> </body> </html> foo.php // send the message back to js. echo json_encode(array('msg' => $_POST['msg_from_js']));
  8. A simple example. foo.php echo json_encode(array('msg' => 'Hello from foo.php')); index.html <!DOCTYPE html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.js"></script> <script> $(document).ready(function() { $("#linky").click(function() { $.ajax({ url: 'foo.php', type: 'POST', dataType: json, success(response) { $('#foo').html(response.msg); } }); }); }); </script> </head> <body> <a href="#" id="linky">Click</a> <div id="foo"></div> </body> </html> I generally return JSON form ajax as it allows you to easily pass back more than one value. Plenty more examples in the docs. http://api.jquery.com/jQuery.ajax/
  9. They are not called cascading styles sheets for nothing. You simply override what you need to closer to the context.
  10. The site doesn't make sense. What the hell are you selling?
  11. You can't just put files in your OS's file system root and have them display, the server has it's own root. No idea where it is in WamServer, but it will be something like C:\PathToWampServer\htdocs
  12. You should read this: http://www.phpfreaks.com/forums/index.php?topic=323280.0 Seriously, if your not using a framework you have rocks in your head. Your code looks like a mix of jQuery and vanilla JavaScript. If you really are using jQuery, take a look at there Ajax functionality.
  13. if ($result =mysql_query("SELECT id, username FROM users WHERE lastvisit > '$tm' and online='ON'")) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_array($result)){ echo "<tr><td><a href=\"profile.php?id={$row['id']}\">$row['username']</td></tr>"; } } } ?> Then on profile.php have a query that uses the value passed in through $_GET['id'] to that gets a users details.
  14. trq

    PHP PDO

    Did you notice that most other peoples code here is syntax highlighted and easy to read? tags do that.
  15. trq

    Adobe Shadow

    Yeah we've been using this at work since it came out. Awesome tool!
  16. I personally don't like the overhead, or the idea of having to learn some other syntax. You can achieve the same goals using php alone.
  17. Your code makes little sense. $this->filename should be set to your template. Anyway, why re-invent the wheel? If you must use a template engine of some sort (which I would recommend against) there are plenty of solutions already out there.
  18. I'm not a code ignitor user, but something like: $this->session->set_userdata('history', array_merge($this->session->get_userdata('history', $history)); should do the trick.
  19. I'm a massive vim fan so don't really have much of an opinion when it comes to IDE's.
  20. That's because MS sux balls.
  21. Hmmm, I smell spam.
  22. There is no definitive answer, just opinion. Often the one that is well suited to your style of development and specific project requirements will be the best one to use.
  23. I used to use dynamically loading js, but it ended up being allot more efficient to put all js into one file and the minify it. Its the actual http requests to multiple files that hurts more than size. Of course it would also depend on what sizes where talking about. Loading a 50k-80k file just to use one function etc etc.
  24. Have you checked out some of the editors mentioned in this thread?
  25. This board is here for questions directly relating to already existing Third Party code. It is NOT a code repository or the place to post requests looking for specific scripts. If you can't find the script you are looking for on Google, you either don't know how to use Google or the specific script does not exist. DO NOT request help with searching.
×
×
  • 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.