Jump to content

bwochinski

Members
  • Posts

    116
  • Joined

  • Last visited

Everything posted by bwochinski

  1. oh... line 29... sorry. Well, the error basically means that your SQL isn't valid. Echo it out before the query, or try running it directly against the database. Even if it returns 0 rows, a valid query will return a useable mySQL resource.
  2. ok then... you can check out dir(). They have a small example on that page. You could return the list to an array for further sorting.
  3. You have some extra text before your $sql variable... (row 29->)$sql = mysql_query("SELECT DATE_...
  4. list($user, $password) = explode('[]', $_COOKIE['login_cookie']); if ($passw->password == $pass) {
  5. For a simple listing, you can try scandir()
  6. Well it's a SQL syntax error, so the problem is with one of your SQL statements. Try echoing the statements before you run the query, so you can see what is actually being sent. Often times unexpected variable values can cause this.
  7. Now there's a different variable mismatch... can you see it?? I also might wonder about your cookie domain. (in the login script) I would probably just set it to ".mtechdev.com", but I obviously don't know your server setup, so you may have your reasons.
  8. That isn't how you form an INSERT query... $sql = "INSERT INTO messages (calleridname, create_date, callerid, phonenumber, message) VALUES ('$calleridname', CURDATE(), '$callerid', '$phonenumber', '$message')";
  9. In your SQL you have "SELECT `password` FROM..." but then when you compare passwords in your if statement you try to pull from the field "user_password" $qu = mysql_query("SELECT `password` FROM `members` WHERE `username` = '".addslashes($user)."'"); $passw = mysql_fetch_object($qu); if ($passw->user_password == $pass) {
  10. You're advancing the pointer on your mySQL results before you begin the while loop with this line:: $row_Recordset1 = mysql_fetch_assoc($Recordset1); Just before your headers.
  11. You're going to have to explain exactly what it is you want to do, preferably in terms of an example.
  12. $query_rs_refs = "UPDATE fg_user SET refsneeded=".echo $row_rs_rewards['referralpoints']; Don't think the echo should be in there.
  13. You can find functions to do that for you by searching for "php ordinal suffix"
  14. You'll need to use a mysql_query() in there somewhere before your if statement...
  15. I think this is the SQL you would want... SELECT * FROM TB1 LEFT JOIN TB2 ON name=nick WHERE country='USA'; But I'm really not sure what this data is or what you're trying to do.
  16. close... but you have to go back into PHP when inserting your variable into the HTML <?php $page="1"; ?> <a href="fav.php?page=<?=$page;?>">I like it!</a> (the syntax highlighter here doesn't like the <?= tag)
  17. I assume this was accidentally submitted before the post was finished.
  18. <?php $sql = "SELECT UserID, SUM(Views) as totalviews FROM photos GROUP BY UserID"; $result = mysql_query($sql); while ( $row = mysql_fetch_object($result) ) { $views[$row->UserID] = $row->totalviews; } echo '<pre>'; print_r($views); echo '</pre>'; ?> This will allow you to get total counts for all users, which I then put into an array with the userID as the key and view count as the value.
  19. I believe the problem is with your "mysql_select_db()" function. You tell it to select "mydb", while phpMyAdmin shows the DB name as "leisnerr_mydb". Most hosts are going to prepend your username to the databases to prevent name collisions on shared servers.
  20. What is already in the database that you are trying to restore to? That is what will determine how the exported SQL should be structured.
  21. First of all... are you sure the table hasn't been created? Because there is a problem with your if/else statement: Namely that there is an "else" condition at all. The if checks if the connection has been made, if not, it displays "could not connect", but if the connection was made, then the "else" condition is executed, which displays "error creating table" before it even gets to the code to try and create it. That is just echoed though, so the script will still continue to execute the table creation query. You probably aren't getting any error specifics because the "mysql_error()" fuction isn't returning anything. (because there wasn't an error!)
  22. Are the player info and ratings already stored in a database? If so, it's a matter of a simple SELECT and a few lines of PHP to automatically show the current ratings. If the players aren't stored in a database, you should make that happen.
  23. That's mostly a matter of preference. I assume you're talking about phpMyAdmin as the web panel, which works very well for easy database management. I often use it for seeding databases with test data and such. If you've got a lot of data though, you can just run SQL statements through phpMyAdmin so that you don't have to keep revisiting the insert page.
  24. ahhh I see. Well, just so you know, I've never actually used a "CREATE DATABASE" statement myself because of the restrictions hosts usually put on mySQL. If you had a dedicated server, then you would have full control over these kinds of things, but that's a fairly hefty cost and certainly not needed. For the tutorial, just skip the create database part and set up the database through cPanel. You should be pretty much set thereafter.
  25. what is the application you're designing that you want to create new databases?
×
×
  • 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.