Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. dont wrap field names inside quotes INSERT INTO gallery (imgpath) VALUES ('$filename')
  2. SELECT name FROM table ORDER BY name ASC
  3. $row[] is an array.... and why are you running a loop within a loop
  4. Have you tried changing the order of your GROUP BY to have the enquieryRef at the start?
  5. erm... There can be a login table if you make a login table.
  6. I think it may be a flaw in your logic, that when the final record is selected the value then = the (select) value rather than being <> the (select) value. Best i can come up with from the information given.
  7. First Place I would look would be the mysql_real_escape_string(). As this isn't user chosen data you don't in theory need to use the real escape, but if you do want to use it I would suggest applying a quoted str to the variable first and then apply the real escape. Hope that helps.
  8. The easier (and in my opinion) better way would be to use the ODBC if you can. If Yahoo won't support you in doing this then I suggest moving to 34SP.com as I know for a fact that I have ODBC access to my several MySQL databases I get from hosting with them. I would make this sound less like an advert if I had working knowledge of other hosting companies that provided the service - but I don't, although I do hope some other people will post some up. I personaly suggest sticking with what you know just now and moving once you have the knowledge and confidence that if something goes wrong somewhere along the line, you will be able to sort it. Oh, and I only asked as your thread title is asking the oposite of what you are in the post
  9. I'm sorry - what is it that you want to do? Do you know that MS Access has an ODBC conection layer that can run the MySQL ODBC Connector driver and just link directly to your MySQL database tables its self?
  10. "then it don't doing anything..." isn't a productive description of your problem. What would be better would be telling us exactly what it DOES do (even if it's only producing a blank page) versus what you are trying to make it do. In addition to that, a couple of things you should be aware of : 1- you should never store passwords in plain text 2- all I or anyone else would need to gain someones password would be their email address (you should at least think about mailing the associated password to the address given) 3- you have no data sanitisation what so ever going on in the page, and as such your form is completly open to attack.
  11. As data is fetched asyncronously by MySQL, the id field is indead contiguious, the OP said that the column was deffinately auto_inc and the example dataset shows no indication of entry timestamping: I stand by (probably in complete error, but in the absence of a better idea) the issue being with select returning the data without a fixed order being declared.
  12. it's impossabe to tell from the information given if the sequencing is off on entry or return. MySQL does not automaticly return information in a set order, you need to use the "order by" clause for that - Try appending ORDER BY id at the end of the SELECT query and see what happens.
  13. could you elaborate please.
  14. Including some better error capture would help find out what the actual problem is : or die ("Couldn't connect to server. The following error occured :<br><br>".mssql_error());
  15. And assuming that ID field is an auto_inc integer - don't wrap it in quotes.
  16. yeah - stop using select * INSERT INTO <table1> (field2, field3, field4...) SELECT (field2, filed3, filed4... FROM <table2> WHERE field1 = [value])
  17. Muddy_Funster

    query

    Create a BLOB field : http://dev.mysql.com/doc/refman/5.0/en/blob.html
  18. don't follow.... explain please what do you think is wrong with the OP code Use of an INNER JOIN on the tables pos & pourbaskets would provide the 1->1 relationship that he wants between the fields. SELECT sum(pos.amount) FROM pos INNER JOIN pourbaskets ON (pos.enqRef = pourbaskets.enquieryRef), jobs WHERE pos.currency = '£' AND pos.jobRef = jobs.id AND jobs.isInvoiced = 1 AND pourbaskets.vat = '0.00'[code] For example would be a better way of doing it.
  19. Without knowing your tables - I have no idea
  20. It's just easier to manage on bigger pages, using the . concatination method can get quite confusing when there is a lot going on, and makes it easier to make mistakes. If it were to affect speed or resource it would be so negligable that you would be hard pressed to notice.
  21. $q = "SELECT RegisteredUsers FROM student WHERE cname = {$_GET['cname']}"; While you can drop a flat variable between double quotes and it will parse the contents- when you are using an array you need to wrap it inside {} to have it recognised. In addition, you must always put quotes arround the array key that you are pointing at (otherwise PHP sees it as constant, not a variable.) Also, you need to be consistant with your error capture - you use or die () in the first page during query execution, but not the second.
  22. Learn how to use JOIN - it's a core part of MySQL syntax for anyone using more than 1 table.
  23. try just $__TEXT__[$fields]
  24. what does print_r($row); give you?
×
×
  • 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.