Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. have you tried: SELECT `categories`.`cat_id`, `categories`.`cat_name`, `forums`.`forum_name`, `threads`.`thread_id` FROM `categories` INNER JOIN `forums`ON (categories.cat_id = forums.cat_id) LEFT JOIN `threads` ON (threads.forum_id = forums.forum_id) ORDER BY `categories`.`cat_order` ASC
  2. risky thing to play with in this climate of dynamicly assigned IP addresses and the such. are you focusing purely on IPv4 or are you accomidating the IPv6 market as well?
  3. so what you're looking for is this ?: UPDATE `apartments` SET mainImage = CONCAT(ID, '-', SupplierID, '-', 0 ,'.jpg') WHERE InternalSupplierID=7;
  4. mssql was depreciated as a driver by microsoft themselves, which is a pain because it was more in keeping with the function set of others like mysql. It's likely that mssql does not have fully supported ODBC connection settings within the database drivers any more, it's microsoft's style of things when they upgrade. because of this I would suggest that you replace all youe mssql functions with the sqlsrv eqivelents, to save problems in the future.
  5. what's the problem when you try that in PHPMyAdmin?
  6. I'm sorry.....are you actualy planning to put a web front end on an ACCESS databash? Asides from the fact that ACCESS is totaly useles at several things (processing SQL, negotiating network transfer protocalls and having no clear grasp of optimistic locking being three big ones) It's also licensed by microsoft to a very limited number of simultanious access requests. None of this adds up to being a good backend for a web interface.
  7. The only issue I can see that could apply to validation is, that as far as I know, you should be echoing 'selected="selected"' rather than just echoing 'selected'.
  8. These gaps are not harmfull, they are there for a good reason. Auto_Inc is normaly only used for indexed keys. As such the number is relative to an indexed postion within the table. Each new row added to the table will get an indexed postion after the last row that was added, even if there have been other rows that have been deleted in between times. The database is perfectly happy with these missing rows, otherwise I imagine you would be forced to re-index every time deleted a row.
  9. how do you actualy KNOW what photo number any given image is with respect to an album?
  10. not with the information that you have given I don't think. There may be a couple of methods that will get the results that you are looking for, but we will need to know exactly what you are doing. Are you creating a new table? could you provide your actual table structure for the database that you are working on?
  11. is that from within a WHILE loop?
  12. Just going to have to chalk this one up as "Something that can't be done in PHP" I guess.
  13. It could be done in a single query - in theory. You would need to subquery each and every form table selecting the records and limiting to 30 resutls per query, then cross refference the results returned against the overall schema and produce your "master" result set, this would then need to be manipulated for pagination, and would only be relevent for a limited time. It is, in my oppinion, over complicating a simple issue.
  14. I think you are looking at that the wrong way round, rather than "whats the least I can get away with" you should be asking, "is there anything else that I can do" - personal oppinion. you should at least have -accurate character validation -mysql_real_eascape_sring() on every input -proper sanitisation
  15. your LEFT JOINS are still there, I added an INNER JOIN to replace the line in your WHERE clause that reads AND entity_contacts.entityRef = entity_details.id
  16. to be honest there is nothing obviously wrong here, All I have done is add some parenthesis and put in an inner join instead of comparing the fields in the WHERE clause, but it looks ok other than that. SELECT entity_details.name, entity_contacts.name AS cName, emailT.email, telT.tel, countryTable.country, entity_contacts.id FROM (SELECT countries.country FROM countries, entity_details WHERE countries.id = entity_details.countryRef) AS countryTable, entity_details INNER JOIN entity_contacts ON (entity_contacts.entityRef = entity_details.id) LEFT JOIN entity_contacts_emails AS emailT ON (emailT.contactRef = entity_contacts.id) LEFT JOIN entity_contacts_telephones AS telT ON (telT.contactRef = entity_contacts.id) WHERE ((entity_contacts.isPrimary = 1) (AND entity_details.ownerRef = 1))
  17. moslt likely there is no column called "id" in the entity_contacts table. lets see your table structure if that's not the problem.
  18. I tried the prepare/execute method to test if the query was working, it returned "1" so as far as it was concerned the execute succeeded. I unfortunately can't get the result set that I need without doing it this way, so it's basicly an all or nothing deal. Thanks for having a look though, I appreciate your time. Interestingly, if a little off topic, the query runns in MS query within Excel, producing the desired results, but when I select the "return data to excel spreadsheet" It tries to rerun the query only to sit there and fill in cell A1 with the message "Data from Query...". Probably related, but likely insignificantly so.
  19. What happens if you cahnge line 29 in globals to require_once('./include/classes/' . $class_name . '.php'); if that doesn't work it could be to do with the camel case, I read some place that it can be a problem on some server types.
  20. No, it is a select query, it just has to build a couple of temp tables on the fly and run a counter to filter off consecutive values from them before the desired results themselves can be generated with what is left. an example result set when run within the database it's self is: ------------------------------------------- sheetID 115003 115152 115581 120427 120428 120463 120683 121096 122962 123474 123476 123525 123526 123529 123530 123531 123532 123533 123534 123535 123569 123728 ------------------------------------------- As I said, I know the query works, even checking that the SQL that is being parsed is correct, which it is. It's just not running using PHP.
  21. again - depends on the server side language, in PHP it is the file() function that you would be looking at for example.
  22. don't know if it helps, but when print_r($result) is run it returns "Resource id #6" This is really starting to wind me up. I have also changed the execution to sqlsrv_execute() and run it through that, which returned a value of 1, signaling that the query ran. This was after about 0.5 seconds, when I know the actual query takes about 17-20 seconds to run. Please, someone - what am I missing? :'( :'(
  23. depends on your server side lanquage, but it's nothing to do with HTML, your looking for PHP/ASP/AJAX assistance
  24. by not using frames. CSS is what you are looking for.
×
×
  • 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.