Search Results

Search found 15 results on 1 pages for 'user300371'.

Page 1/1 | 1 

  • Learn ASP.NET or Python for web development?

    - by user300371
    I am new to programming and only know html,css,PHP and would like to start learning another new language. I am focused on web development and would just like to get your opinion on ASP.net and python. Which language would serve me best in making sites as to general programming? ASP.NET or django python? I know Python is "easy to learn" and similar to PHP, but ASP.net is also a good language.

    Read the article

  • How to make an add friend/defriend function in PHP?

    - by user300371
    I have created a site where people can create a profile. But I am trying to figure out how to start on making an add friend button so users can have friends. In my user table, i have user_id, first_name, last_name, email, etc. Should I somehow relate the user_id of the user and the friend in a friend table? I am a novice to programming, so these things are still new to me. Thanks!

    Read the article

  • Having some trouble in my pagation code(PHP)

    - by user300371
    My table is posting and in that table, it shows all the posting people put in. I am trying to make page navigation links at the bottom of the posts. the function generateenter code here_page_links does all the work. The code seem to be only showing the "<-" and "-" and not the link numbers. I think the function is only reading the $_GET['posting'] ==1. (this code is from the Oreilly PHP/MySQL book. I am using it as practice) function generate_page_links($cur_page, $num_pages) { $page_links = ''; // If this page is not the first page, generate the "previous" link if ($cur_page > 1) { //cur_page is just a number that is gotten from the url. $page_links .= '<a href="' . $_SERVER['PHP_SELF'] . '?page=' . ($cur_page - 1) . '"><--</a> '; } else { $page_links .= '<- '; } // Loop through the pages generating the page number links for ($i = 1; $i <= $num_pages; $i++) { if ($cur_page == $i) { $page_links .= ' ' . $i; } else { $page_links .= ' <a href="' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=' . $sort . '&page=' . $i . '"> ' . $i . '</a>'; } } // If this page is not the last page, generate the "next" link if ($cur_page < $num_pages) { $page_links .= ' <a href="' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=' . $sort . '&page=' . ($cur_page + 1) . '">-></a>'; } if ($cur_page == $num_pages){ //the last page $page_links .= ' ->'; } return $page_links; //need to return this variable in the function } // Calculate pagination information $cur_page = isset($_GET['page']) ? $_GET['page'] : 1; $results_per_page = 3; // number of results per page $skip = (($cur_page - 1) * $results_per_page); $query = "SELECT * FROM posting ORDER BY date_added DESC"; $data = mysqli_query($dbc, $query); $total = mysqli_num_rows($data); $num_pages = ceil($total / $results_per_page); //Query again to get just the subset of results $query = $query . " LIMIT $skip, $results_per_page"; $result = mysqli_query($dbc, $query); echo '<table>'; echo '<tr><td><b>Title</b></td><td><b>Date Posted</b></td></tr>'; while ($row = mysqli_fetch_array($result)) { echo '<tr><td><a href="ad.php? posting_id='.$row['posting_id'].' ">'.$row['title'].'</a></td>'; echo '<td>'.$row['date_added'].'</td>'; //echo '<td>'.$row['name'].'</td></tr>'; } echo '</table>'; // Generate navigational page links if we have more than one page if ($num_pages > 1) { echo generate_page_links($user_search, $sort, $cur_page, $num_pages); }

    Read the article

  • Is it best to code from a blank sheet or improving a code that's already written?

    - by user300371
    Just had a curious thought, but for general coding and programming, do you think it's best to work out all the logic yourself and start from a blank sheet or just take a code that has been written already(by you or someone else) and just change it to your liking? Assuming you have a programming background of like 1year+. (because as a beginner, it's best to learn from nothing) I'm not saying copy+paste someone else's code and say it's yours.

    Read the article

  • Can't seem to get my like/dislike to work in PHP

    - by user300371
    My table is comment_likedislike. It has the comment_counterid, comment_counter, comment_id(which is from another table) fields. And I have an url (LIKE) that when clicked would link to this code and get the comment_id and like_id. I want to do a count where if it is the first 'like', it would store a new comment_counter in the comment_likedislike table. But if there is already a 'like' for the comment in the table, it would just update the comment_counter to +1. Problem: When I run this code, it doesn't UPDATE(1st statement) but INSERT(2nd if statement) no matter if there is a like for the comment or not. I don't think the code is checking if the comment_id is in the table already. I am a novice php programmer. Thanks! if (isset($_GET['comment_id']) && isset($_GET['like_id'])) { $query5="SELECT * FROM comment_likedislike "; $data5=mysqli_query ($dbc, $query5); while ($row5= mysqli_fetch_array($data5)){ $comment_id2=$row5['comment_id']; } if ($comment_id2 == $_GET['comment_id']){ $counter=$row5['comment_counter']; $counter++; $query= "UPDATE comment_likedislike SET comment_counter ='$counter' WHERE comment_id= '".$_GET['comment_id']."' "; mysqli_query($dbc, $query); } if ($comment_id2 != $_GET['comment_id']) { $counter2=1; $query9 = "INSERT INTO comment_likedislike (comment_counter, comment_id) VALUES ('$counter2', '".$_GET['comment_id']."' )"; mysqli_query($dbc, $query9); } }

    Read the article

1