smile, but i'm cry because i have an php problem!

Alles, was PHP betrifft, kann hier besprochen werden.

smile, but i'm cry because i have an php problem!

Postby Bastl1801 » 24. August 2006 15:18

:arrow: :wink: :cry: :? :evil: :!: :x :oops: 8) :( :) :D :D :arrow:
Sorry but i'm gone crazy!
I have written a code but it doesn't work, so waht shall i do?
look at this *beep* code:
Code: Select all


   $select = "FROM $dbn_c
      WHERE c_status='active'";
   if ($searchquery)
      $sql_query = build_sql_query($searchquery, $dbn_c);
   if ($sql_query)
      $select .= " AND ($sql_query)";
   if ($cat_id) {
      if ($cat_id == "de") {
         $select .= " AND (
            c_cat_id='7' OR
            c_cat_id='8' OR
            c_cat_id='9' OR
            c_cat_id='10' OR
            c_cat_id='11' OR
      } elseif ($cat_id == "en") {
         $select .= " AND (
            c_cat_id='19' OR
            c_cat_id='20' OR
            c_cat_id='21' OR
            c_cat_id='22' OR
            c_cat_id='23' OR
      } else {
         $select .= " AND c_cat_id='$cat_id'";
   $query = mysql_db_query($db_name, "SELECT COUNT(*) $select") or print_error(mysql_error());
   $hits = ($query>0) ? mysql_result($query,0,0) : "0";

   list($navi, $limit) = explode("#",build_site_nav($hits));
   $sql = "SELECT *
      ORDER BY c_timestamp DESC
   $query = mysql_db_query($db_name, $sql) or print_error(mysql_error());

   <form method="GET" name="searchform">
   <input type="hidden" name="cat_id" value="<?=$cat_id?>">
   <p align="center">
      Beitr&auml;ge nach <input type="text" name="searchquery" size="20">
      <input type="submit" value="durchsuchen">
   while ($row = mysql_fetch_array($query)) {

   <table width="680"  border="0" cellspacing="0" cellpadding="0">
     <tr bgcolor="#57798a">
       <td colspan="2"><span class="Stil6"><?=$row[author]?></span></td>
     <tr bgcolor="#FFFFFF">
       <td colspan="2"><span class="Stil13"><?=$row[title]?></span></td>
     <tr bgcolor="#FFFFFF">
       <td align="left" class="Stil11"> <?=$row[p_place]?></td>
       <td align="right" class="Stil11"><?=$row[publication]?></td>

   print "<p align=center>$navi</p>";


So my Problem is, i know that the pc has an realationshio to mysql, but he don't show me any things out of my table in my database!
So please help me, i can understand German but i'm not in good in writing German!
by KB
Posts: 18
Joined: 18. August 2006 10:40

Return to PHP

Who is online

Users browsing this forum: No registered users and 2 guests