Jump to content

budimir

Members
  • Posts

    522
  • Joined

  • Last visited

Everything posted by budimir

  1. It needs to be like this <table> <tr> <td>Username: <td>First Name: </tr> <?php while ($info = mysqli_fetch_array($result)) { ?> <tr> <td><? echo $info['username']; ?> <td><? echo $info['firstname']; ?> </tr> <?php } ?> </table> Now, it's gonna be OK
  2. Hey guys, I have this peace of code and it works except one thing for which I can't figure out how to do, so I need your help: <?php $datum_od = date("Y-m-d",mktime(0,0,0,($_GET["timestamp"]))); //echo "Od - $datum_od<br>"; $datum_do = date("Y-m-d",mktime(0,0,0,($_GET["timestamp1"]))); //echo "Do - $datum_do"; if (isset($where)) unset($where); if ($HTTP_GET_VARS["korisnik"]) $where[] = " upisao='".$HTTP_GET_VARS["korisnik"]."' "; if ($HTTP_GET_VARS["datum_od"]) $where[] = " datum='".$datum_od."' "; if ($HTTP_GET_VARS["datum_do"]) $where[] = " datum='".$datum_do."' "; if (is_array($where)) $addToSql = " WHERE ".implode(" AND ", $where); $upit = "SELECT * FROM obilasci ".$addToSql." $limit"; $rezultat = mysql_query($upit); $broj = mysql_num_rows($rezultat); while ($row = mysql_fetch_array($rezultat)){ while(list($key,$val) = each($row)){ if (is_int($key)) continue; $GLOBALS[$key] = $val; } } ?> So, I want the query to search between $datum_od and $datum_do! How to do that??
  3. Use double quotes $url = "http://h3swatlg.exofire.net/profile.php\";
  4. Try to google a little bit for basics of php and mysql!!! This is not a forum for teaching, but helping. Do some work yourself!! You can do all of that stuff you asked in one script which you can name whatever you want. When you get there and get into trouble, come back and we'll help you out.
  5. Try to echo your query first, and also put $result = mysql_query($query) or die (mysql_error()); And then you'll see what is happening!!!!
  6. You can add mysql_num_rows and do an if statment like this $num = mysql_num_rows($data); if ($num >= 0){ do you're stuff and go in } else { do nothing and go out }
  7. OK, thanks, I got an idea!
  8. Is this destroying you're session??? You don't need to use multidimensional arrays!
  9. Hey guys, Don't worry about the loop it's working perfectly. But my question is: How can I display all the records from DB if I select everyone??? For example: Everyone //This is displaying the records for all the persons John Doe //This is displaying only the records for John Doe Jane Doe //This is displaying only the records for Jane Doe <option value="What do I need to put here???">Everyone</option>
  10. Hey guys, I need small help How can I make select box to show all the records from the db, not only what is selected??? Here is my code!! <select name="korisnik" id="korisnik"> <option value="">Svi</option> <?php $upit = mysql_query("SELECT * FROM korisnici"); while ($row = mysql_fetch_array($upit)){ while(list($key,$val) = each($row)){ if (is_int($key)) continue; $GLOBALS[$key] = $val; } echo "<option value='".$ime." ".$prezime."'>".$ime." ".$prezime."</option>"; } ?> </select>
  11. Post some code and we will help you...
  12. You got it all wrong!!! It should be like this $sql = "UPDATE `Users` SET username = '$muser', firstname = '$mfname', lastname = '$mlname', permission = '$mau' WHERE username ='$oun' "; also when you execute your query put or die (mysql_error()); So you could see the error you are getting
  13. Great!!! This was your problem $_SESSION['company'] = $company; Hit "Topic solved" and enjoy!!!
  14. This is the correct way if( $num_rows > 0 ) { $_SESSION['username'] = $username; $_SESSION['company'] = $company; //redirect $data = mysql_fetch_array($results); header("Location: {$data['company']}.php"); } Is it working now????
  15. Don't give up, you'll get the idea what is wrong!!! OK, I think you have only missed one step: You did this yesterday $_SESSION['username'] = $username; You know what you need to do with... $_SESSION['company'] You get the idea????
  16. Hey there, I see you are still strugling with the problem. $_SESSION['company'] Where do you set this variable????? I can't see it!
  17. OK, so the query for joining the names to it's ID in a dieffernt table is "SELECT * FROM members LEFT JOIN scores ON members.id = scores.member_id ORDER BY name ASC"; I think that is what you are asking for!! Correct???
  18. Yep, that's right, but as I understand his query didn't work at all!! If you want all the data from the table then just remove LIMIT 1 from the edn oh the query!!!
  19. Well, the problem is that I don't know the names of the db fields, so it's hard to make the query correct. The sintaks you wrote is OK, but you need to check the names of db fields and what are you joining where.
  20. Try this: SELECT * FROM members LEFT JOIN scores ON s.member_id = m.id ORDER BY m.id ASC LIMIT 1 Try to echo it to see the result, or copy/paste to phpmyadmin to see the result.
  21. Try to search on google for "MySQL Join"!!! You will get the answer to your question!
  22. <a href="javascript:history.go(-1)">Back</a> Here is declared! And for the button you don't need to do anything. Just copy paste the thing i wrote and that is it.
  23. Of course you do. I only gave you a starting point.
  24. You could do a simple back link/button with javascript. As a link: <a href="#" onClick="history.go(-1)">Back[/url] As a button: <input type=button value="Back" onClick="history.go(-1)"> Hope, that helps!!!
  25. Try like this $company = $data['company']; echo "$company"; If you're not getting a value here that's why you are not redirected. Also do you have a page some_company_name.php Because if it finds the value, but it can't redirect than it has no use. If a user is form Ford and you want to redirect him to that page, you need to have ford.php page!!! You know that, right????
×
×
  • 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.