Jump to content

ryanfilard

Members
  • Posts

    252
  • Joined

  • Last visited

Posts posted by ryanfilard

  1. this is all of my php code

     

    <?php require_once('Connections/news.php'); ?>
    <?php
    $id = $_REQUEST['id'];
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    mysql_select_db($database_news, $news);
    $query_news = "SELECT * FROM news WHERE id = '$id'";
    $news = mysql_query($query_news, $news) or die(mysql_error());
    $row_news = mysql_fetch_assoc($news);
    $totalRows_news = mysql_num_rows($news);
    
    mysql_select_db($database_news, $news);
    $query_arguments = "SELECT * FROM argue WHERE pid = '$id'";
    $arguments = mysql_query($query_arguments, $news) or die(mysql_error());
    $row_arguments = mysql_fetch_assoc($arguments);
    $totalRows_arguments = mysql_num_rows($arguments);
    ?>

  2. What is wrong?

     

    Warning: mysql_select_db(): supplied resource is not a valid MySQL-Link resource in /home/rweekly/public_html/2012/view_arguments.php on line 41

     

    Warning: mysql_query(): supplied resource is not a valid MySQL-Link resource in /home/rweekly/public_html/2012/view_arguments.php on line 43

     

    mysql_select_db($database_news, $news);
    $query_news = "SELECT * FROM news WHERE id = '$id'";
    $news = mysql_query($query_news, $news) or die(mysql_error());
    $row_news = mysql_fetch_assoc($news);
    $totalRows_news = mysql_num_rows($news);
    
    mysql_select_db($database_news, $news);
    $query_arguments = "SELECT * FROM argue WHERE pid = '$id'";
    $arguments = mysql_query($query_arguments, $news) or die(mysql_error());
    $row_arguments = mysql_fetch_assoc($arguments);
    $totalRows_arguments = mysql_num_rows($arguments);
    

  3. This does not work correctly and I need help with it. If $rating is equal to zero it displays 4 stars on this page http://rwdev.whekle.com/view.php?id=4571

    what I am doing wrong, it is probably a simple mistake.

    if($rating <= '1.5'){
       $star1 = "yes";
    }elseif($rating <= '2.5'){
        $star2 = "yes";
    }elseif($rating <= '3.5'){
         $star3 = "yes";
    }elseif($rating <= '4.5'){
           $star4 = "yes";
    }elseif($rating <= '5.0'){
       $star5 = "yes";
    }
    

  4. No here is my form that submits.

     

    <form method="post" action="view.php?id=<?PHP echo $_REQUEST['id']; ?>"> 
                                  <input name="star2" type="radio" class="star" value="1"/>
    <input name="star2" type="radio" class="star" value="2"/>
    <input name="star2" type="radio" class="star" value="3"/>
    <input name="star2" type="radio" class="star" value="4"/>
    <input name="star2" type="radio" class="star" value="5"/> 
    <input type="hidden" name="formcheck" value="rating">
    <input name="rate" type="submit" id="rate" value="Rate"> 
    </form>

  5. I am trying to make a rating system and this script is not working.

     

    $ratingget = $_REQUEST['star2'];
    mysql_select_db($database_news, $news);
    $query_ratingsys = "UPDATE news SET votes = votes +1 AND rating = rating +'$ratingget' WHERE id = '$id'";
    $ratingsys = mysql_query($query_ratingsys, $news) or die(mysql_error());

  6. I spent over 3 months coding and planing this website with other and I expect it to be done in about 1 more week. I was contacted by a school teacher with 200 students in total, she was asking me if it is okay for students to register. I said yes because I am adding a lot of new privacy features. She is going to use it in about a month. Do you think it is ready for action?

     

    http://www.celbre.com

     

    Demo User: ptest

    Demo Pass: ptest1

  7. I am trying to make my database search only search where private = '$priiv'(Usually 0,1, or 2) but it does not work

     
    $query_search = "SELECT * FROM users WHERE username LIKE '%$idea%' OR fname LIKE '%$idea%' OR lname LIKE '%$idea%' OR tags LIKE '%$idea%' AND private = '$priiv'";
    

     

    What am i doing wrong?

  8. I am developing an android application called PHP Phactory I am still working on the name. The program is for android phones and tablet but would be best suited for a tablet. With this program you can write and execute php scripts. Is this something that you would use?

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