Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. <?php `cp /www/network/other/*.* /www/network/Database/$platform/$fv` ?>
  2. http://php.net/reflection
  3. All you need to really do is put your code into a string, then insert it into the database. What exactly is the issue? Why you would want to be executing code stored within a database however is beyond me.
  4. Its better but $database and $validate appear from nowhere. this completely breaks the entire idea of encapsulation.
  5. There are plenty of frameworks around that provide crud. symfony for one.
  6. Another reason to name your variables with a bit more meaning.
  7. This lookss kinda like a forum, surely posts should be sorted by date/time.
  8. Be careful what you wish for. My off-sider not long ago got made redundant because of the CMS I developed.
  9. Your not using the entire concept of a class properly. Don't use globals within class methods to pass data around. Your missing the entire point of classes. You should be using private properties to store data belonging to a class. This data is the accessible to all methods within said class.
  10. If your looking for someone to do this for you you need to go to the freelance board, read the stickies then post your request. Otherwise, your going to need to be allot more specific.
  11. Front page is probably considered the worst editor ever made by most, there is a thread here that may help you. Its always best to search a forum before posting.
  12. The query needs to go within the loop just like my previous post showed. Your foreach syntax is way off too, + you have removed the quotes around the index Artist within the $_POST array.
  13. Something like.... $artists = $_POST['Artists']; foreach ($artists as $artist) { $artist = mysql_real_escape_string($artist); $id = $_SESSION['id']; $sql = "INSERT INTO tbl (artist_id, user_id) VALUES ($artist, $id)"; mysql_query($sql); }
  14. Each artist should be stored in a separate row within the database. This way you would simply execute a query such as.... SELECT artistname FROM userfavs WHERE user_id = 22
  15. Yes its possible but you would need to maintained yourself. May I ask what the field is to be used for?
  16. Urls are executed as web pages by the server, hence all you where getting was the output your class.my-sql.php script produced which is likely a blank page.
  17. Given your example, a is an object of type string. Everything is an object in Javascript, same as in Python, Ruby and probably a few other languages.
  18. UPDATE tbl SET fld = fld+1 WHERE ip = '10.1.1.1'
  19. mysql_query expects the first argument to be a string containing your query. mysqli_query on the other hand expects your connection resource. If your host doesn't support mysqli I would switch hosts to be honest. Its a fairly standard extension.
  20. Because unlike php where there are different data types all data within Javascript is an object. eg; You can call methods on a string because it is a string object. 'this is a string set to uppercase'.toUpperCase();
  21. Strings need to be surrounded by quotes in php, not numbers.
  22. You haven't really given us much to go on but I would guess.... Within your first method, change.... $obj->get_content(); to $this->get_content();
  23. To get the author names for the article 'test'. SELECT DISTINCT authors.name FROM article_authors, articles, authors WHERE article_authors.author_id = articles.id AND articles.title = 'test' Would return Sean and Sara.
  24. You should probably start by learning whatever technology your going to use.
  25. In this case you want a third table 'article_authors' used to join the articles and authors together. eg; [pre] table articleauthors : ---------------------------- article_id | author_id ---------------------------- 0 | 1 0 | 2 1 | 1 1 | 2 1 | 3 ---------------- [/pre]
×
×
  • 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.