Jump to content

Dânêl

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Everything posted by Dânêl

  1. I edited my last post. read it again
  2. Hi, every time this piece of code is executed array($id,$gender,$level) willi replace the previous memorized. You shoul use something like this to make it work: <?php foreach($id as $var){ $_SESSION['athletes'][] = array($id, $gender , $level); } ?> But reading better your code I think there are some other mistakes. Everytime the while is executed it adds in id array the current athlete id, then your foreach reporcesses previous ids and the new one. id shoulden't be an array and so the foreach is useless while($athlete=mysql_fetch_assoc($athletearray)) <?php $id=$athlete['id']; $level=$athlete['level']; $gender=$athlete['gender']; $_SESSION['athletes'][] = array($id, $gender , $level); } // end for each } ?>
  3. I think the only way is to use PHP Socket and allowing your local machine to accept incoming connection and share that file. One way is to open the port number 80 and install a program acting as a http server or a ftp server (in this case you have to open port 21).
  4. I love it when there are no followed standards.... It is quite impossible to have a truly db abstraction layer. I have to think much about to do as much as possible without make it unreadable or too big and less-sense
  5. Really ? thanks Is it a good idea to use a function for every different sql istruction (select,update,delete,insert) ? I see them studying some DB classes and abstraction layers taken from OpenSource project and frameworks. I think this way makes a bit hard the use of nested queries (like a Select inside a Select) or JOINs: it requires too much code even if it make possible to use non standard, db specific, sql query or change query only once for (maybe possible?) future SQL commands update. Isn't it? What is better? A general or a specific query function?
  6. Thanks to all for your replies. I agreed with you, but unfortunately usually I write little script for people who had already hosted their sites and for this I know hosting with PDO, SOAP disabled. I wrote also a gallery in PHP and then discovered that the hoster disabled GD. As a result I had to disable checks and Image resizing. It's a mystery for me the reason why well paid hosting service have these limitations... As regards the answers to my questions. SO what I need is something like this? <?php interface db_wrapper { //Execute a query public function query($query); // Other functions } class Db implements db_wrapper { private $dbclass; public function __construct() { $this->dbclass = new TheClassYouLike(); } public function query($query) { $this->dbclass->execute($query); } } ?>
  7. Hi, I'm writing some personal library also to do practice with OOP... In particular I'm working on a user class which uses database and I want to do it simply reusable in different environments For example I want to do it database type and database class independent. Is it possible? I will try to explain this. There could be already defined a Database class inside a project. How could I do to use it or mine database class without troubles? I thought to use some class properties as functions (like C function pointer) and editing them with constructor allowing for example, the use of mysql_query instead of mysqli_query or "my_mysql_query" . Is this a good way or not? An abstraction layer could be better but I have to know how are defined third part db classes, right? PS: I know the existence of PDO but it can be disabled by the hosting provider (I know some hoster doing this...) Thanks for any hints
  8. Hi, you have to search this PHP.ini settings: session.use_only_cookie . it should be set to 0 to allow session ID in URL
  9. HI, try to use jS instead of js...and it should works "s" is used for seconds, "S" for the ordinal suffix
  10. Hi, to have always the next highest integer you have to use ceil() instead of round()
  11. I think this is what you need http://www.phpfreaks.com/tutorial/handling-xml-data The first example explain how using XML is much easier and faster
  12. With xml everything could be easier. Anyway, I think you should load the HTML page into PHP (using fopen and fread) and then you could use regular expressions to find data. I can't post some code now because I didn't' use regular expression so much....so I don't remember them very well. I need to make some tests before posting examples to make them fullly functionally
  13. I'm not sure about what do you want to do. Your intention is to read data from that table with PHP and sending it to a mysql db? How does table data change ? (e.g. after a form submit, script execution...) I don't think reading data from html is a good solution. Knowing how data changes could suggest a better way. Temporizing script execution is possible if you could use Cron job, otherwise you have to call the appropriate PHP script
  14. Thanks for replies. Well: This is the actual system type I thought to use . But it is a bit limited and less elegant, in my opinion. But it is the only way I find This is a good solution but in my context and for what I need it is a bit too complicated. Thanks anyway, it colud be useful in future. Searching in this forum I read about using bit for permission. It could be an elegant e good solution, but if i need to show or not a button or link based on user permission the only way to do that is to use a similar code like that posted budimir ?
  15. Hi, first of all, I hope you can understand me...I know my big english limits. Sorry for those I am at my first serious big project and i nedd to implement an user permission system. Because of my quite inexistent experience I would know your opinion about the best way to do that. In this project I use smarty as template engine and I need to set some recstriction for editing post, delete images and so on, including obviously setting moderators and admins. I hope this short descriptions is sufficient...sorry if not. Well, what is your opinion about?
×
×
  • 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.