Jump to content

henricar

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by henricar

  1. Hello, I was using the mail() function on a free web space provider and recently switched to Web Host Freaks and the function stopped working... Since this forum is "partner" to the webhost, I was wondering if anyone could give me a quick fix to enable the mail() function. Thanks!
  2. First of all, I'm pretty sure this doesn't fit into the MySQL Help category but couldn't find any other one that was better.. so here goes: Do you guys have any recommendations as to a reliable, high-quality web hosting service that provides MySQL and PHP support? Thanks!
  3. sorry about that I meant array! this is what I get when I look at the source: <input type="checkbox" name="tags[]" value="bla">bla <input type="checkbox" name="tags[]" value="csd">csd <input type="checkbox" name="tags[]" value="sfvdk">sfvdk
  4. just cheked and the value="" value is not a string.. weird..
  5. no.. it still returns Array but the font was different.
  6. sure, field markup is: <form action="index.php?p=dosuggtag" method="POST"><input type="hidden" name="sid" value="'. $suggestionid .'"> <b>Suggested Tags:</b> '; while ($i < count($tagarray)) { echo '<input type="checkbox" name="tags[]" value="'. $tagarray[$i] .'">'; echo $tagarray[$i]; echo ' '; $i++; } echo' </td> </tr> <tr> <td width="100%" align="left"> <input type="submit" value="Update Tags"> </td></form> and code to process the array is: $suggtagarray = $_POST['tags']; print_r ($suggtagarray);
  7. Hey guys, I am using multiple inputs (checkboxes) to pass values to another page (I have named them name="blabla[]" in order to pass the values an as array). The problem is when I print_r the array, I get "Array" as a result... I have tried imploding it to a string but it doesn't seem to be working. Any ideas on what could be causing this? Thank you
  8. hey everyone, I am trying to fetch an array using the WHERE condition. What I would like to do is set the WHERE equal to multiple values (as an array). This is the code I have but it doesn't seem to be working.. could anyone please help me? Thank you! $fetchfol = mysql_query("SELECT * FROM following WHERE bywho='$currentuserid'"); $folarray = mysql_fetch_array($fetchfol); $folarray = $folarray['followwho']; $fetchsresults = "SELECT * FROM posts WHERE (bywho = '$folarray') ORDER BY popularity DESC";
  9. hey thanks for the reply! sorry I took a while to answers but I've been studying for finals and I'm in over my head but what exactly do the a b c and do here?
  10. Hey guys, here is what I'm trying to do: I have a table width user data. I have a table width posts from users. I have a table with people's votes of the posts. Can I get the number of people who voted for a post made by a particular user? I could fetch all posts made by a certain user, but who do I "scan" for all votes using this array? thanks!
  11. hi QuickOldCar, thanks for answering. Currently, I have a table named "posts" with [id, title, description, category, date posted and views] as rows. What the sresults.php script does is it takes the text input from the form on the previous page and brings back any post that is LIKE %$keyword% in the title or in the description. I then display the results using a while loop. What I currently have for "sorting" is this: $keywords = $_POST['keywords']; $orderby = $_GET['oby']; $cat = $_GET['cat']; $keywords = strtoupper($keywords); $keywords = trim($keywords); if ($keywords == '' AND $orderby == '' AND $cat == '') { echo 'please enter a keyword'; } else { if (!($orderby == '') and !($cat == '')) { if ($orderby == 'ddesc') { $fetchsresults = mysql_query("SELECT * FROM posts WHERE (upper(title) LIKE '%$keywords%' OR upper(description) LIKE '%$keywords%') AND category='$cat' ORDER BY id DESC LIMIT 10"); } if ($orderby == 'dasc') { $fetchsresults = mysql_query("SELECT * FROM posts WHERE (upper(title) LIKE '%$keywords%' OR upper(description) LIKE '%$keywords%') AND category='$cat' ORDER BY id ASC LIMIT 10"); } } elseif (!($orderby == '') and ($cat == '')) { if ($orderby == 'ddesc') { $fetchsresults = mysql_query("SELECT * FROM posts WHERE (upper(title) LIKE '%$keywords%' OR upper(description) LIKE '%$keywords%') ORDER BY id DESC LIMIT 10"); } } elseif ($orderby == '' and !($cat == '')) { $fetchsresults = mysql_query("SELECT * FROM posts WHERE (upper(title) LIKE '%$keywords%' OR upper(description) LIKE '%$keywords%') AND category='$cat' LIMIT 6"); } else { $fetchsresults = mysql_query("SELECT * FROM posts WHERE (upper(title) LIKE '%$keywords%' OR upper(description) LIKE '%$keywords%') LIMIT 10"); } $colors = Array('itemsmainpageA','itemsmainpageB'); $col = 0; while($sresultsarray = mysql_fetch_array($fetchsresults)){ .... and the links to "sort by" go like this: $currenturl = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; <a href="'. $currenturl .'&oby=ddesc">Most Recent</a> so basically if no keyword is entered and no category or orderby methed is provided, the script returns "please enter keywords" in any other case, the script detects if a sorting method and/or category is selected and provides the corresponding posts thanks for any help
  12. Hey guys, I'm looking for some sort of tutorial on how to code a search script which would allow users to select number of results per page (and take care of the page 1, page 2, etc. links accordingly) as well as order them by date, most views, etc. I thought I'd be good to do this on my own but my script is looking very dirty and I'm pretty sure it isn't very secure.. anyone ever consult a tutorial with main guidance as how to code the kind of script I'm interested in?? thanks
  13. I had thought about doing it that way but the clicks I want to monitor are one to pages external to my website.. plus they open in a new window :s. I think looking into Ajax would be my best bet...
  14. Hey guys, I was wondering if it is possible to have a value inserted into a table as someone clicks on a link (in order to count views for example)? thanks!
  15. like I understand the code you previously posted but it still we be updating "popularity" only when a post get liked, viewed or disliked. I still need to popularity to fluctuate on a dailay basis given the spread between current date and date posted is growing by the day. any solution to this?
  16. hey here is the exact stucture of the 3 tables concerned. [attachment deleted by admin]
  17. seem to have run into a little problem though :/... the algorithm for popularity is P = (20*likes -20*dislikes + views)/(today's date - date posted). Is it possible to make this work? like have a trigger occur daily to calculate the difference between today's date and the date posted?
  18. great, thanks! will give the triggers a thourough read, and you're right: learning new skill = good
  19. hey thanks for the reply! but this method seems quite advanced and I'm kind of a php noob.. would you be able to suggest another way I could attain this goal? thanks
  20. Hey guys, I'm new here so hello... but I'll get right to the point: I have a table named POSTS, where I store user posts. In this table, I have a row named "Popularity". Now I would like the value of "Popularity" to be a function of the number of Likes, Dislikes, Views and Date posted, all of which are stored in respective tables (linked by Primary and Secondary keys). I was wondering if it actually is possible to have the value of "Popularity" adjust automatically when a change in "Likes", "Dislikes" or "Views" occurs. And if not, what alternatives I have. The ultimate reason I need to have this value stored in a table and up to date is that I wish to sort posts by "Popularity". Many thanks !!!
×
×
  • 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.