הרשם שאלות ותשובות רשימת חברים לוח שנה חיפוש הודעות מהיום סמן פורומים כנקראו

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 20-05-06, 01:37   # 1
Alter
תודה על תרומתך.
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 35
הודעות: 3,103

Alter לא מחובר  

אין שגיאות, כמו שאמרתי, הוא מציג את המידע מצויין!
רק שזה לא יעיל שאני צריך לעשות פעמיים התחברות לבסיס הנתונים בשביל הקטע הזה בגלל שאני משתמש בפונקציות.
הקוד:
PHP קוד:
<?php 
ob_start
();
/** 
*
* @package ------
* @version $id: index.php, v.0.1.8 20/05/2006 00:47:40
* @copyright (c) 2006 Ron Alter and EliHai Sasi
*
*/

/*
* Index page
*/

// define the core path
define('CORE''./core/');

// require database class and connect
require_once CORE "classes/database.php";
$db = new database;
$db1 = new database;
// connect to mysql with class and config
//require_once . "./conf_global.php";
$db->connect('localhost''user''pass''user');  
$db1->connect('localhost''user''pass''user');  
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <script type="text/javascript" src="script.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
    <link rel="stylesheet" type="text/css" href="css/global.css">
</head>
<body>
<?php

if($_GET['act'] == "view") {
    
$db->query("SELECT * FROM categories ORDER BY id aSC");
    while (
$categorie $db->fetch_array())    {
        
$rows $db->num_rows();
        if(!empty(
$rows)) { 
?>
    <table border="0" width="85%" class="table">
        <tr>
            <td class="td1"><div align="center" class="text_title"><? echo  $categorie['category'?> - id <? echo  $categorie['id'?></div></td>
        </tr>
<?

            $db1
->query("SELECT * FROM articles WHERE cid = " $categorie['id'] . " ORDER BY title ASC");
            while(
$x $db1->fetch_array()) {
                echo 
"        <tr>
            <td class='text'><a href='articles.php?id=" 
$x['id'] . "&amp;cid=" $x['cid'] . "' class='text'>" $x['title'] . "</a></td>
        </tr>
"
;
}
?>
    </table>
<?
        
}
    elseif(empty(
$rows))    { 
        echo (
"  "); 
    }
}
}
?>


<?php ob_end_flush(); ?>
אני זז לישון, בבוקר אני חוזר, תודה על העזרה.
__________________
Alter.
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 

כלים לאשכול
תצורת הצגה

חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 22:07.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ