Jump to content

fantomel

Members
  • Posts

    186
  • Joined

  • Last visited

Posts posted by fantomel

  1. Hello i'm trying to get some data from mysql but i run into a problem and i don't know how to fix it please can someone help me ?

     

     

     

    function get_bottom_menu() {
        $query = "SELECT * FROM cms_pages WHERE active = 1 ORDER BY position";
        $result = mysql_query($query);
        while($check = mysql_fetch_array($result)) {
        echo "<a href="index.php?page=" . $check['page_id'] . ">" . ['link_name'] "."</a>";
        }
    
    
    }

  2. Hello i have a small problem with a table i don't know how to add some columns left and right with a 12px width but to be above the top column and header and bottom column... so here is my code for the moment.

     

     

     

     

    <style type="text/css">
    html {
    height: 100%;
    }
    body {
    margin: 0;
    padding: 0;
    background: #999999;
    color: #000033;
    height: 100%;
    }
    #wrapper {
    height: 100%;
    width: 95%;
    background: #DDEEFF;
    color: #000033;
    }
    #wrapper td {
    vertical-align: top;
    }
    #header {
    height: 384px;
    background-color: #000059;
    color: #F2F2FF;
    }
    
    #topcol {
    height: 12px;
    background-color: #CCFF33;
    color: #F2F2FF;
    }
    
    #bottomcol {
    height: 12px;
    background: #80A7E0;
    color: #000033;
    }
    #content {
    background: #FBFBFF;
    color: #000033;
    border-left: 1px solid #000055; 
    border-right: 1px solid #000055;
    } 
    </style>
    </head>
    <body>
    <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0" id="wrapper">
      <tr>
        <td id="topcol" colspan="3">
          <tr>
        <td id="header" colspan="3">
        </td>
      </tr>
        </td>
      </tr>
      <tr>
        <td id="content"><p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p></td>
      </tr>
      <tr>
        <td id="bottomcol" colspan="3"> </td>
      </tr>
    </table>
    
    
    

  3. Hello i'm trying to build a cms from scratch for a website.. something very simple a dynamic menu + dynamic content add/edit/delete does anyone has a design for a cms ? a diagram... i would really apreciate for sharing..

  4. have you checked the paths for the css file ? i often had problems with my path to css file from localhost to the webserver.

     

     

    <head>
         <link rel="stylesheet" href="/styles.css" type="text/css">
    </head>

     

    /styles.css

    ? can't understand this part why do you have a "/" in front of styles.css

  5. Hello i was thinking to do some debug system for a script using if:

    something like this:

    to add a code like if page == sql_debug then show a java text box will show on that page to run diferent querrys i want .. .and diferent things depends on what i want.

    Is it posible can someone show me an example  ? :-? thank you very much

  6. --
    -- Table structure for table `internet_hours`
    --
    
    CREATE TABLE IF NOT EXISTS `internet_hours` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `price` decimal(10,0) NOT NULL,
      `how_many_hours` int(11) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
    
    --
    -- Dumping data for table `internet_hours`
    --
    
    INSERT INTO `internet_hours` (`id`, `price`, `how_many_hours`) VALUES
    (1, '25000', 1),
    (2, '25000', 1);

     

    i've made the changes :)

  7. aham :)

     

    i'm a beginer in php .. and php math it's very new to me .. :) including most of mysql commands i learn .. when a i do something new just for testing or personal.

     

     

    after you'v seen the table is it corect your first post ?

     

    to use this command :

     

    SELECT SUM(column) FROM table WHERE...

  8. thank you for your reply this is what i want to do:

     

     

    CREATE TABLE IF NOT EXISTS `internet_hours` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `price` varchar(70) NOT NULL,
      `how_many_hours` varchar(10) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
    

     

    i work at internet cafe and i want to know how much money i got how many hours have the clients bought because now we have some sodas and stuff for sale.. and i wanna know exacly how when where.. :)) it's a personal project :)

     

    for the moment all i want to do is to insert the price of an hour or half an hour in the db and then get the total of the sum i have there :)

     

     

    --
    -- Table structure for table `internet_hours`
    --
    
    CREATE TABLE IF NOT EXISTS `internet_hours` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `price` varchar(70) NOT NULL,
      `how_many_hours` varchar(10) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
    
    --
    -- Dumping data for table `internet_hours`
    --
    
    INSERT INTO `internet_hours` (`id`, `price`, `how_many_hours`) VALUES
    (1, '25000', '1'),
    (2, '25000', '1');
    
    

     

    as you see i've inserted some example datas:) and then on my page i will hit show report and then show me a page with all the data for example or only the total sum of the money

  9. hello first of all sorry for my english and my writing i'm a little in hurry cuz i have to get some sleep i have a simple small question.

     

    This is my first time working with php maths and i need to do a script that will do something like this:

     

    1. insert a number like 25000 in a table and when i hit a button to show all the data from db i want to make a total.

    ex: 25+25 = 50 -> it's about money and i want to see a total after i hit show report... can someone help me with an explanation ..?

  10. hello i have a question can it be done in php a custom error when we have an error in php code .. or something like that... to show a page custom made.. like 404 error... and for msql .. errors.. same question :D

  11. Hello i have a small problem with a mysql class and i can't get it fixed.

     

     

    These are the errors :

    Warning: Missing argument 1 for MySQL::__construct(), called in C:\webserver\public_html\core\core.php on line 9 and defined in C:\webserver\public_html\classes\mysql.class.php on line 11
    
    Warning: Missing argument 2 for MySQL::__construct(), called in C:\webserver\public_html\core\core.php on line 9 and defined in C:\webserver\public_html\classes\mysql.class.php on line 11
    
    Warning: Missing argument 3 for MySQL::__construct(), called in C:\webserver\public_html\core\core.php on line 9 and defined in C:\webserver\public_html\classes\mysql.class.php on line 11
    
    Warning: Missing argument 4 for MySQL::__construct(), called in C:\webserver\public_html\core\core.php on line 9 and defined in C:\webserver\public_html\classes\mysql.class.php on line 11
    
    Fatal error: Class 'Inter_error' not found in C:\webserver\public_html\classes\mysql.class.php on line 20

     

    my core.php php code:

     

    <?php
    require '../classes/mysql.class.php';
    global $db;
    $db = &new MySQL(localhost, root, root, testing); 
    ?>
    

     

    my mysql class :

     

    class MySQL
    {
    var $host;
    var $name;
    var $pass;
    var $dba;
    var $resultLink;
    private $connection;
    
    public function __construct($host, $name, $pass, $dba)
    {
    	if($host && $name && $pass & $dba) {
    		if(!$this->connection = mysql_connect($host,$name,$pass))
    		throw new MySQL_error("Database Connection Failed!");
    
    		if(!mysql_select_db($dba, $this->connection))
    		throw new MySQL_error("Database Can't Be Selected");
    	} else {
    		throw new Inter_error("Method: __construct--Error:Incorect arg(requires \$host, \$name, \$pass, \$dba)!!!!");
    	}
    }
    ?>
    
    

     

    in mysql i have added only the part where it gives the errors.

    Please can someone help me ?

  12. attached is a small script that tests SQL statements... its definitely not pretty and not optimized but its gets the job done which is: send a query and see the results.  I've found it useful to debug sql-related errors by echoing my $sql variable and then copy and pasting it into the script to see what happens... easier than var_dumping everything :)

     

    im kind of tied up at work but if the OP is still having problems i'll be happy to check back and help later!

     

    -Alex

     

    very nice script and yes it's very useful for debuging :)

×
×
  • 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.