Jump to content

kusal

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Everything posted by kusal

  1. kusal

    session

    <?php session_start(); ob_start(); //Turn on output buffering $host="localhost"; // Host name $username="root"; // Mysql username $password="root123"; // Mysql password $db_name="test"; // Database name $tbl=$_POST['rating']; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="describe $tbl"; $result=mysql_query($sql); $count=mysql_num_rows($result); global $x; for($x=0; $x<$count; $x++){          $newArray = mysql_fetch_array($result); $aa=$newArray['Field']; $_SESSION[$x]=$aa; } ?> <a href="dynamic2.php">dynamic2</a> //dynamic2.php <?php session_start(); $one=$_SESSION['0']; echo "$one"; ?> Notice: Undefined offset: 0 in c:\Inetpub\wwwroot\test\dynamic2.php on line 4 what is the problem here?
  2. kusal

    dynamic

    can i use [b]show table[/b] and [b]describe[/b] table_name to get the info, let say that i get those info but how can i create relevant html page and php pages.
  3. kusal

    dynamic

    the problem is not how to create a table or retrieving data from it. ex: the project is that i create an invetory control system for computer hardware devices for a mobile telephone company in sri lanka. the company has pc,routers,servers,laptops,printer,telephones.....etc,  to be stock controlled. so i have created tables for every device with there uniqe attributes. and created funtions like add,delete,update,view...etc, for every table using php and mysql NOW THE PROBLEM IS THAT COMPANY IS ASKING ME TO CREATE A FUNCTION THAT, IF THEY COME ACROSS NEW HARDWARE DEVICE (EX: ISP LOAD BALANCER, WHICH IS NOT CREATED ABOVE) THEY NEED TO CREATE A TABLE FOR IT AND NEED TO HAVE ALL ABOVE MENTIONED FUNCTIONS. HOW CAN I DO THIS, I NEED TO CREATE HTML PAGES AND PHP PAGES DYNAMICLY FOR A CHANGING DATABASE.
  4. kusal

    dynamic

    Yes you got the point(but not fully). yes i know that in that way i can create tables, let assume that the above created table needed to insert data (assume that i have given the system to them)then i need to have created a page to add those details in the newly created table. but the problem is, i don't know any details about that table attribute, how can i dynamicaly get those table details to create a adding page
  5. kusal

    dynamic

    yes i know bit of php, i have almost finished my project, but only for the predefiened tables, i don't know a way to get information from tables that i don't know (tables that would be created by the company) (MAN IT'S VERY HARD EXPRESS MY MESSAGE). kusal
  6. kusal

    dynamic

    i can't use 3rd party libaries (it's a project) pure php
  7. kusal

    dynamic

    thing is this, i'm developing a inventory control system for a company(as my 2nd year project) and they request that the system sould be able create tables when they needed, using php. then for more complication the tables will be later used to do functions like add, delete, update....(i think you got the point) but i don't have any idea what would be the attributes of those table bcos they enter those details. so i need a codeing that will take out those attributes from what ever the table and do above mentioned functions
  8. kusal

    dynamic

    can any one help me with a code (thank you for your help "CheesierAngel")
  9. kusal

    dynamic

    is it possible to use php to create dynamic web pages ex ; if i create a table (let assume that i don't know the attributes) is it possible to print its content kusal - sri lanka
  10. <?php // open the connection $conn = mysql_connect("localhost", "root", "kusal"); // pick the database to use mysql_select_db("test",$conn); // create the SQL statement $x=mysql_query("select * FROM test WHERE name = kusal", $conn); // execute the SQL statement print("$x"); echo mysql_error(); ?> (user is varchar) this code gives me the following error why is it? "unknown column 'admin' in 'where clause'" if i change like this $_POST'[username']" the following error, Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in c:\Inetpub\wwwroot\php\log.php on line 9 kusal Sri Lanka
  11. is there a way to give the user a alert message by using PHP5 eg: in a inventory control system each product must be checked for there warranty expiration before 30 days, if a warranty period expiers, the code must give a alert msg after login to the system. thank you kusal - sri lanka
×
×
  • 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.