Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. it means everything after it is not part of the filename and also variables that need to be parsed by the php engine into the $_GET array. not totally sure if that is the right wording or not.
  2. in your sql call do this: SELECT UNIX_TIMESTAMP(date_field) as date FROM table mysql will convert the timestamp field straight to a unix timestamp you can put in the date() fn so you can avoid all the formatting garbage.
  3. what are the file permissions on the pdf/ folder? if you get a permission error like that it usually means the web server user (IIS or Apache) can't access that folder because they don't have read/write privileges. by phpadmin or you referring to phpmyadmin?
  4. that error message could be throwing it off. what is your error reporting set to? have you looked at the line it mentions?
  5. do this instead: echo "<tr>"; echo '<td><a href="details.php">' . $cell1 . '</a></td>'; echo '<td>' . $cell2 . '</td>'; echo '<td>' . $cell3 . '</td>'; echo '<td>' . $cell4 . '</td>'; echo '<td>' . $cell5 . '</td>'; echo '<td>' . $cell6 . '</td>'; echo "</tr>\n"; that way you can pick which cell gets the link.
  6. ok example. <?php bunch of code with some echos. ?> <html>//some html in here</html> ok so this is my php page. i have a code block at the top of the page which does a bunch of evaluations and has some echos. it gets read first and any echos i have in there will get outputting to the browser before any of the lower html code gets outputting. this echo data will hence show up at the top of the page in my browser above any of the html. you can check the source as well to see. if i want any of that php evaluation code to show up in my html page somewhere, i will need to store it in a variable instead of echoing it. then in my html code, i add a php tag in there and echo out the variable here instead of up top in the php code. <?php echo $var; ?> so basically <?php bunch of code with some echos. ?> <html> //some html in here <?php echo $var; ?> //output my variable where ever i want it in my html page. </html> hope this makes more sense.
  7. basically you want to pass some kind of identifier in your links to the other files, usually through the GET array. so <?php echo "<strong>All the topics that got reported</strong>"; echo "<br>"; function topics_reported(){ $query = "SELECT topics.reported AS Number_of_reports, topics.ip AS Users_IP_number, topics.username AS Users_username, id FROM news_comments WHERE reported > 0 ORDER BY abused DESC"; $result = db_query($query); while($r = db_fetch_array($result)) { print_r($r); $link = "change.php?username=" . $r['Users_username']; $linktext = "Click to change reports"; echo "<a href=\"$link\">$linktext</a>"; echo "<br>"; } } ?> look at the link i use. now in my other file use $username = $_GET['username']; to access that variable. now I can use that in my db query. the variable can be interchanged to whatever you need. hope this helps. let me know if you run into any problems.
  8. remember that when using the echo it will appear in the page exactly where the php engine evaluated it. In this case it sounds like that is being evaluated before or after all your html is being outputted. If you want that text in a certain place, put it in a variable instead of outputting it then output that variable in the proper text block. ie. your right box content box Does that make sense?
  9. well you have <font color=red>Please Enter a username!</font> in both your form blocks so it will show up no matter what. also you aren't checking for the form submitting, just if the $_POST['user'] is empty. if you want to check for the form posting use: if($_POST['submit']){}
  10. i would start with this: <?php print_r($_GET); $con = mysql_connect("localhost","root"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("boardtesting", $con); $q = mysql_query("SELECT * FROM `topic` WHERE `id` = " . intval($_GET["id"])) or die(mysql_error()); echo $q; $arr = mysql_fetch_array($q)); mysql_close($con); ?> that will print your GET array so you can see if the GET var is being passed or not then echo out your sql statement so you can see if it looks right or not.
  11. this all stems around your query. i would use phpmyadmin and just test queries on your db until you get the results you want. the query looks fine to me though i'm unsure what LIKE "%%" will do if one of the fields is blank. I assume it will match anything but never tested that. i would also echo your sql query out so you can see exactly what the db is running.
  12. well for one you don't receive an error because you're not outputting any mysql error. for debugging you should use mysql_query($sql) or die(mysql_error()); also your insert query is wrong. mysql_query("INSERT INTO hits VALUES ($URL, , )"); change that to mysql_query("INSERT INTO hits (URL, counter) VALUES ('$URL',1)"); you dont need that extra update after your insert. i'm not sure what the third field in your table is but if you don't want to insert anything into it you don't have to put it in your query.
  13. id go with the second option and send the email if you successfully enter the info into the db. use the mail function in php to send the email. www.php.net/mail most servers should have the mail function set up.
  14. for debug purposes change this $result = mysql_query($sql); to $result = mysql_query($sql) or die(mysql_error()); the query looks good though. what's happening when you try it?
  15. hmmm not sure. never used that before.
  16. i think im starting to understand what you want to do but i don't think you'll be able to use the ON query with your db field as a string. you're going to need to use LIKE and have a strict string storing convention in the DB. you will need to have a separating character after every value in the string. so "4, 5, 12, 14, 21, 22" in the db will need to be ",4, 5, 12, 14, 21, 22," so you can properly identify each value. then you can do something like SELECT id FROM PortfolioItems WHERE categories like "%,5,%" OR categories like "%,6,%" OR categories like "%,7,%" etc etc does that make sense?
  17. if category is filled with strings like "2,11,16,17" I dont think your IN query will work. Your query SELECT id FROM PortfolioItems WHERE categories IN (5,6,7) is the same as SELECT id FROM PortfolioItems WHERE categories 5 OR categories = 6 OR categories = 7 and hence I don't think it will match any records, like you said. Because these numbers aren't quoted either, it thinks they are ints.
  18. also why are you looping through your array values when you are searching by the IN clause. dont you want to loops through the results of your query instead? $catQuery = "SELECT id FROM PortfolioItems WHERE categories IN (".$catArray.")"; $catResult = mysql_query($catQuery)or die("Query failed - $catQuery - " . mysql_error()); while($row = mysql_fetch_array($catResult)) array_push($portfolioItemCats, $row['id']);
  19. looks like your missing a space. $catQuery = "SELECT id FROM PortfolioItems WHERE categories IN (".$catArray.")";
  20. add this at the top somewhere print_r($_POST); then add the echo in at your sql statement // set new user default privacy settings $sql = "INSERT INTO privacy (videocomments, profilecomments, privatemessage, friendsinvite, newsletter, user_id, publicfavorites, publicplaylists) VALUES ('yes', 'yes', 'yes', 'yes', 'yes', '$user_id', 'yes', 'yes')"; echo $sql; $query = @mysql_query($sql);
  21. echo your sql statement and print_r your post vars. that should give you an idea about where things are going wrong and be able to track it back.
×
×
  • 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.