Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. You could try loading everything that you want on the page at the start, and then hiding the bottom stuff untill the button is clicked to reveal it. That way everything is being pre-populated from the php and there should be no problems.
  2. Your welcome - does that meen it worked?
  3. it's generaly a matter of prefference as to whether you alias or not. I only alias when I am working with somone elses databases and they have done something crazy like put spaces in the table names. I find it easier not having to remember what letter goes with what table and so forth. let me know how that tableName.* works out.
  4. Posting the php file that actualy has the error in it would be a great help.
  5. give this a shot: <?php if(isset ($submit)){ //connects to database include 'config.php'; include 'opendb.php'; //Get email 1 and 2 preventing SQL injections. Get pass one 1 and 2 with md5 hash $email1 = mysql_real_escape_string($_POST['email1']); $email2 = mysql_real_escape_string($_POST['email2']); $password1 = md5($_POST['pass1']); $password2 = md5($_POST['pass2']); //create error message for blank fields $errorBlank = "Please fill out all fields!"; //check if email1 is blank and matches email 2 if (empty($_POST['email1'])) { echo "<p class=\"error\">$errorBlank</p>"; } else { $email1 = mysql_real_escape_string($_POST['email1']); } } ?> <form name="register" action="PHP_SELF?$submit='true'" method="post">
  6. try making it just backgound: url("/images/bg.jpg"); rather than background-image: url("/images/bg.jpg");
  7. I have never tied a tableName.* select I don't have a clue if it will work or not. But that won't work regardless as you have reffered to the actual table name in the select, and then aliased it. Either use aliasName.field or remove th AS xx , and please please please don't use * unless you absoloutly have to
  8. if you examin your select statement SELECT u.* FROM `users` AS u it shows that you are selecting information from all the fields in the users table, so $qry = 'SELECT u.* FROM `users` AS u JOIN `user_status` AS us ON u.id = us.user_id JOIN `friends` AS f ON us.user_id = f.friend_id WHERE f.user_id = '.$user->id $result = mysql_query($qry) or die (mysql_error()); WHILE ($users = mysql_fetch_assoc($result)){ echo '<div class="statusfeed">' . '<div style="float:left; width:65px; height:65px;;">' . '<a href="/profile.php?uid='.$users['id'].'"> <img src="/resize_image.php?file='.$users['avatar'].'&size=65" title="" border="0" /> </a>' . '</div>' . '<div style="margin-left:65px;">' . '<div style="text-align:left; padding:5px;">' . '<span> <a href="/profile.php?uid='.$users['id'].'">' . ucwords($users['username']) . '</a> ' . $row['status'] . ' </span>' . '</div>' . '<div style="text-align:left; padding:0px 5px 5px 5px;">' . '<span style="font-size:10px;">Posted on: ' . time_since($row['posted']) . '</span>' . '</div>' . '<div style="padding:5px;">' . '<div style="margin-left:105px; text-align:right;">' . '<a href="#" onclick="showComments(\'comment'.$row['id'].'\')">View Comments(0)</a>' . ' - ' . '<a href="/profile.php?uid='.$users['id'].'">View Profile</a>' . '</div>' . '</div>' . '</div>' . '</div>' . '<div id="comment'.$row['id'].'" style="border-left:1px solid #000; border-right:1px solid #000; border-bottom:1px solid #000; display:none; width:350px">' . ' COMMENTSSSS ' . '</div>'; } should work just fine. By using the the JOINs you are afactivly telling the select query that there is a relationship between the two or more tables that you are joining, and that it must respect the rules of that relationship when it is selecting the information from any one of them. hope this helps
  9. Try changing it to : while($row=mysql_fetch_assoc($result)) { print('<option value="'.$row['naamRichting'].'">'.$row['naamRichting'].'</option>'); } And see how you get along. You shouldn't set selected= during a while loop as you are efectivly telling the browser that every entry is selected at once, and you need to use the value= to make the select box relevent.
  10. order by comes at the end, after the where. and MySQL will not let you return a field name that is ambiguous. Using the joins is not the same as selecting.
  11. Sorry for my ignorance but could you explain why it would be better My Take: Because you would reduce the code significantly and you would also run the query on a database table that has at least 1 indexed field making the process more efficient and ressiliant.
  12. WHERE f.user_id IN = '$user->id' { = Limit results to instances where the user_id in f is the dame as the variable given }
  13. Would be lighter on the server, and leave information in the fields that have been filled in, but OP already said that he/she doesn't want to use JS.
  14. Not at all really, it's just one less thing you will need to put in the database. Run the php through a template file for formating rather than calling the format from the database.
  15. @ignace: my reasoning for storing the html in the database was to enable even the format to be dynamic for each page and not restricted to a fixed template...
  16. Navicat lite is a free cut down version of Navicat for MySQL. You don't get the bells and whistles, but you still get enough functionality to manipulate the data in the database. So long as you have a rough grasp of SQL (mainly in table and index creation) it should do what you need it to.
  17. Purely personal point of view here but MySQL Workbench blows. If you have direct access to the database server and you want to use something that is gui I would say to try Navicat Lite. Although you could always code some input pages just for your own use.
  18. Most people learn to read before they learn to write...It's on the first page http://www.phpfreaks.com/forums/index.php/topic,296708.0.html
  19. You could try leaving the player on the root page and put everything else in the iframe instead.
  20. give this a shot: <?php $query = mysql_query("select friend_id from `friends` where `user_id`='$user->id'"); //Get the friends while($row = mysql_fetch_assoc($query)) { $friend_ids = $row['friend_id']; $query = mysql_query("select user_id from `user_status` where `user_id` = '".$friend_ids."' order by `posted` desc"); while($row = mysql_fetch_assoc($query)) { $query = mysql_query("select * from `users` where `id` = '".$row['user_id']."'"); $users = mysql_fetch_assoc($query); echo $users['username'] . '<br />' . $row['status']; } } ?>
  21. Have you tested your query in MySQL? If not you could try: SELECT tp_id, email, Rating FROM tp_info INNER JOIN user_skills ON (tp_id.tp_info=user_skills.tp_info) WHERE user_skills.sub_id = job_info.sub_id Your use of HAVING is a bit off, it should only be used to limit a GROUP BY, not to refine an existing WHERE clause. Let us know how you get on.
  22. I think you are going to need to feed him a cookie for this one, and then have the page precheck for the cookie and bypass login if it is there. I havn't played with cookies myself though, so can't help you further than that.
  23. I am probably WAY off mark here, but wouldnt this also work? $file_name = $file_name_array['0']; $new_name = str_replace($substr($file_name, -3, 3), 'flv', $file_name);
  24. You are very welcome and best of luck
×
×
  • 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.