Jump to content

freebsdntu

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Everything posted by freebsdntu

  1. I guess it means your resultset is empty,try to debug on that. By the way,is that all the code? If yes,you have to connect to your database first before any operations on it.
  2. I am not sure if there is such a built in function. But I believe you can surely write one yourself.
  3. Thank you for all your inputs, I think I have got it. Thank you very much!
  4. This sounds rationale, but what if I do it like this : 'Hello Word"\n"', it still does not work. I guess I need to check with the escape characters. Since I would have "" symbols inside "" of echo
  5. Thank you for your help, but the problem is not solved, i have a series of echo statements, if I remove \n, then there won't be carriage returns.
  6. I have tried echo 'Hello World!\n', and the out put is like this: Hello World\n I don't know why it is like this.
  7. I guess you just need to configure your apache,then it will be fine
  8. Thank you very much for your kind reply,Daniel0. It is very helpful to me. What I intend to do is do it in a modular fashion, with MVC pattern, ya, but I don't want to try the template engines like cakephp, smarty, etc. I would to create one on my own, also to cater for my own needs. Ok, let's say, in my template, there will be head section, menu section,sidebar section,main content section,footer section,etc,what I am trying to do now is to build a separate .tpl file for each section, but with customizable functionality, i.e. when applying the template head, I shall be able to specify the title of the page. What do you think of my approach? Any suggestions? It is still in my mind, I haven't have clear thoughts how to realize it in codes. So inputs would be greatly appreciated!
  9. You have syntax error in your echo statement,first of all. I suggest you do a google search on the tutorial.
  10. Try to add a ";" after your first die statement. <?php #connect to MySQL $conn = @mysql_connect( "----", "----", "----" ) or die( "Could not connect" ); #select the specified database $rs = mysql_select_db( "votick_banner", $conn ) or die (mysql_error()); ?>
  11. Any reason why never use @? I use @ sign in this situation, it works fine. I suggest you post the banner.php,Vivid Lust, according to the error message,something is wrong on the 6th line. Also, did you do correctly with the database connection setup? Is your $conn successful? Just my 2 cents.
  12. Hi guys, problem regarding template again. How do you write template?In php?Or to write in tpl file?Regarding tpl,how to write?I have searched on tpl, but haven't found any examples on how to write a tpl file. Thank you very much!
  13. Hi guys, I would like to write a template for my personal site, because as I am expanding the site, I find it tedious to correct for each page whenever I make a small change. Any suggestion on where should I start?Thank you very much!
  14. LOL, you are over-praising me, I am just a php starter.
  15. Hi, try this,remove the ' ' surrounding NOW(): $query = "INSERT INTO `order` (type_service, notes, agree, time) VALUES ( '$type_service', '$notes', '$agree',NOW());";
  16. Try to remove the ";" after if (!isset($page)); $page = $_GET["page"]; if (!isset ($page)) { $page = 'index'; }
  17. Thank you for your reply,fenway,I have browsed through some articles on storing hierarchical data, it is too much complicated, when applied to my case, i mean. So is there any other approach? Maybe I should have asked whether would my design work.
  18. I guess it is correct. You can do something directly like if ($_POST['value2']),I suppose. Just my 2 cents worth.
  19. Hi guys, I am designing a database schema for project, where ptitle,pobjective,etc are the attributes. A project might have series of sub-project, and this sub-project might have its own sub-projects, and it goes on like this. If I want to easily list the hierachy of all the projects, what should be the shema look like? Ok, the shcema I am thinking of now is like this: I inlclude a super-project id field, where it is set to 0 if the project does not have any super project, and it is set to the project id of its direct parent project if it is a sub-project of some project. The problem with this design is I don't know how to list the hierachy. Any hints on the schema? Thank you very much!
  20. Guys, please please please help me, I am using ubuntu6.2 with php5, I have installed svn and configured it nicely, the problem is that I cannot access svn using php, the error message is undefined call to function svn_ls(). Is it because I haven't installed php-svn support?I have tried pecl and pear,but there is no such package,can anyone please help me.
  21. This can be done easily in javascript,do a simple google search. Anyway,this is my code,just as a pointer html <select name="select" id = "link"> <option value="#">Sort By...</option> <option value="0">All Members</option> <option value="1">Username</option> <option value="2">Last Online</option> <option value="3">Online Only</option> <option value="4">Offline Only</option> </select> javascript function goto() { var link = document.getElementById("link").value; window.open(link); }
  22. Ah,thank you very much,rajivgonsalves,I got it working now.Thank you very much!
  23. Oh,sorry,I got it wrong,that warning came because I output something before calling session_start() in the file before redirection. But another problem I discovered is that if I invoke methods like $user -> getUsername(), it returns empty string, is this the problem with the $user object?
×
×
  • 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.