Jump to content

J.Daniels

Members
  • Posts

    143
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

J.Daniels's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Just calculate the range before creating your SQL query then use BETWEEN
  2. $curramm is an array. $ammount = $_POST['ammount'] + $curramm; should be: $ammount = $_POST['ammount'] + $curramm[0];
  3. I think the problem is in this line: 26 if (@mysqli_num_rows($r) == 1) { // A match was made. To check the number of rows returned when using mysqli: 26 if ($r->num_rows == 1) { // A match was made. Also, that probably didn't throw an error because error suppression was on (The @ before the function call) EDIT: After looking through your code more, it appears all the SQL function calls may be through a custom interface. I would take off the error suppression to see if any errors come up: 26 if (mysqli_num_rows($r) == 1) { // A match was made.
  4. That is because you are trying to echo out the results of the query: $result = $mysql->query($sql); if ($row = $result->fetch_assoc()){ echo $row['rating']; } else { echo "no results, but here is the error: ",$mysqli->error; }
  5. Also, you can add mysql_error() after trying to INSERT to see if there is an error: mysql_query("INSERT INTO place (ID, Name) VALUES ($newID, $_POST[name]") or die("Error, Insert Failed: ".mysql_error());
  6. If you are using single quotes inside of double quotes, you don't have to escape them. $sql = "SELECT rating from users where username = 'Chris'"; As a side note, MySQL works fine with double quotes.
  7. Does your host allow a custom php.ini? One way to view what settings are loaded is to create a file with: <?php phpinfo(); ?> View that in your web browser and it will list all the PHP settings. Look for upload_max_filesize.
  8. Can you do a view source and post the output of the generated code?
  9. You are missing a closing quote for the href: <a href="view.php?ID=<?php echo ($_SESSION['results'][$i]['ID'])?>"><?php echo htmlspecialchars(stripslashes($_SESSION['results'][$i]['name'])); ?></a>
  10. To format output text from PHP, you need new line characters for line breaks: <?php echo "\n"; ?>
  11. There is upload_max_filesize set in php.ini which defaults to 2 MB.
  12. Also, you need to specify $this when referencing a class variable: Class ABC { static $taken = array(); function setArray() { // connect and query etc.. // extract all the mysql and store it in an array of taken urls while($row = mysql_fetch_array($results)) { $this->taken[] = $row['the_url']; } } function getArray() { // return the array so that a btree can search through them. return $this->taken; } }
  13. Sorry, misread the question. Since the url will be passed through the form, you should be able to access it through the $_POST['url'] variable.
  14. <form action="populate.php?url=<?php echo $_SERVER['REQUEST_URI'] ?>" method="post" name="url">
  15. Looking through the class code, $conn->getResultSet('SELECT * FROM blog'); returns an instance of Pos_MysqlImprovedResult.
×
×
  • 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.