Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. Drop the "group by" at the end of that query, you want to pull all the results out: but only display them in a specific way. You are going to need to code some conditional output into the while loop. Using if's to check if the countryid has changed, then if the sub region id has changed in oreder to format what you output to the screen. Have a bash at it and let us know if you have any problems.
  2. I would also like to suggest that you make sure that your input fields are properly escaped as well as sanitised before hitting the database. It's likely that those 1 and 1 fields are being populated by someone trying to hack your user table with a brute force injection attack. As well as that, I have to assume that you are storing the password as plain text (exactly what they type in the form is what is stored in the table). This is bad if you are, if someone does successfully hack your user table all the information could be handed over to them on a silver platter. You should look into encrypting passwords stored in the table if you are not doing so already.
  3. I feel a more significant difference at this level is that with "print" you can not pass multiple string values into it, unlike "echo".
  4. ok, you don't insert anything into an auto inc filed - EVER. You can't retrieve a resultset from running an INPUT statement. If you want information out of the database you are going to need to run a SELECT on it, so you will need another query.
  5. I would need to see the code for index.php, menu.php, and a sample content page to provide that level of information. It will also likely requre a significant re-write of the code, not something that can be posted up in a hurry. If the OP is prepared to provide the affore mentioned code I will happily have a look at what can be done.
  6. Echo and Print are not exactly the same.
  7. that's really not the best way to do it, you are going to have a hell of a time maintaining that.
  8. try using isset and {} :- if(isset($_SESSION['name'])){ echo "<option value={$_SESSION['name']}>{$_SESSION['name']}</option>"; }
  9. if that doesn't fix it we could use a look at your confirm_query() function.
  10. which part do you need help with exactly?
  11. that is correct. In this case you can use $i = strrpos($query, " "); $ query=substr_replace($query, ":", $i, 1);
  12. you could try str_replace (" ", ":", $query, 1);
  13. what about making this change if(trim($file) == '#3#'){
  14. following the link to http://www.imdbapi.com/?i=tt1324545 you will see that the target page is returning the parse error, not your code. the problem is with the value of tt1324545 - the target site does not like it. revise the values in your database and make sure they are correct.
  15. ahh. I only ment for you to change the letters in assoc: while($info = mysql_fetch_assoc($f)) {
  16. that ones my dyslexia kicking in >_< it should be "mysql_fetch_assoc()"
  17. maybe this can help, it's based on sql server but it's talking about odbc in php - http://stackoverflow.com/questions/689735/insert-binary-data-into-sql-server-using-php
  18. more sillyness on my part : remove the word "htmlencode" from this line: $tid= htmlencode $info['id'];
  19. I missed the ; from the end of the line starting with $url add that in and see what happens.
  20. what does this return? <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("base") or die(mysql_error()); $f = mysql_query("SELECT id FROM movies") or die(mysql_error()); while($info = mysql_fetch_asocc($f)) { $tid= htmlencode $info['id']; $url = "http://www.imdbapi.com/?i=$tid" echo "<br>$url<br>"; $link = file_get_contents($url); $json = json_decode($link,true); print_r($json); echo "<br><br><strong>".$json['Title']."</strong><br><br>"; } ?>
  21. I only gave you 4 lines of code, can we see your full page of code?
  22. a better way would be <?php include("config.php"); $content = $_POST['content']; $link = $_POST['link']; $title = $_POST['title']; $pass = $_POST['password']; $qry = "UPDATE sites SET content = '$content', link = '$link' WHERE title='$title' and password='$pass'"; mysql_query($qry) or die (mysql_error()); echo "Site Updated"; mysql_close($con); ?>
  23. this is actualy a PHP issue, but your solution is : ... $link_info = $info['id']; $link = file_get_contents("http://www.imdbapi.com/?i=$link_info"); $json = json_decode($link,true); echo $json["Title"]; ...
  24. yeah, but the OP is only trying to get the neerest square that can be used without going over the original number...either that or I totally missread the post (it's been a long day)
×
×
  • 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.