Jump to content

williamh69

Members
  • Posts

    25
  • Joined

  • Last visited

Recent Profile Visitors

2,403 profile views

williamh69's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi guys i am populating products from db, but the images does not showing sequentially, there are gaps between images ,,how i can fix this this is my code: <?php $query = "SELECT * FROM products"; $select_products = mysqli_query($connection, $query); while ($row = mysqli_fetch_assoc($select_products)){ $product_id = $row['product_id']; $product_title = $row['product_title']; $product_image = $row['product_image']; $product_description = $row['product_description']; $product_quantity = $row['product_quantity']; $product_price = $row['product_price']; $short_desc = $row['short_desc']; ?> <div class="col-sm-4 col-lg-4 col-md-4"> <div class="thumbnail"> <img src="./images/<?php echo $product_image ?>" width="478" height="1034" alt=""> <div class="caption"> <h4 class="pull-right">$<?php echo $product_price ?></h4> <h4><a href="#"><?php echo $product_title ?></a> </h4> <p><?php echo $product_description ?>.</p> </div> <div class="ratings"> <p class="pull-right">18 reviews</p> <p> <span class="glyphicon glyphicon-star"></span> <span class="glyphicon glyphicon-star"></span> <span class="glyphicon glyphicon-star"></span> <span class="glyphicon glyphicon-star"></span> <span class="glyphicon glyphicon-star-empty"></span> </p> </div> </div> </div> <?php } ?>
  2. Hi guys i have this error, Parse error: syntax error, unexpected end of file in C:\wamp64\www\nigthclub\videos.php on line 103 but i know is probably easy to solve but for some reason i dont see the error. please help me <?php session_start(); ?> <?php error_reporting (E_ALL ^ E_NOTICE); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="style.css" rel="stylesheet" type="text/css" /> <link href="tablefiestas.css" rel="stylesheet" type="text/css" /> <title>La Taverna de Juan</title> </head> <body> <div id="container"> <div id="header"> <!--MENU BAR--> <?php include("includes/db.php"); ?> </div> <!--VIDEOS--> <?php $query = ("SELECT * from videos"); $result = mysqli_query($connection,$query); $num_per_page =05; ?> <table border="1" width="100%"> <tr> <td>Video Id</td> <td>Titulo</td> <td>Video</td> </tr> <tr> <?php while ($row=mysqli_fetch_assoc($result)) { $videoid = $row['videoid']; $titulo = $row['titulo']; $url_video = $row['url_video']; ?> <td><?php echo $videoid ?></td> <td><?php echo $titulo ?></td> <td><?php echo $url_video ?></td> </tr> <?php}?> </table> <?php $query = "SELECT * from videos"; $pr_result = mysqli_query($connection,$query); $totalrecord = mysqli_num_rows($pr_result); echo $totalrecord; ?> <br> <div id="footer"> <!--FOOTER--> <?php include("includes/footer.inc.php"); ?> </div> </div> </body> </html>
  3. hi trying to make a grid of two columns , data from db using mysqli and php, but it does not work...can you guys help me thanks in advance <?php $limit=2; $count=0; echo"<table border='0' align='center' cellpadding='2' cellspacing='2' width='70%'>"; $query = "SELECT * FROM posts"; $select_all_categories_query = mysqli_query($connection, $query); while ($row = mysqli_fetch_assoc($select_all_categories_query)){ $post_image = $row['post_image']; $post_title = $row['post_title']; $post_content = $row['post_content']; $post_user = $row['post_user']; $post_date = $row['post_date']; if ($count < $limit) { if($count ==0) { echo"<tr>"; } echo"<div class='post-img'>"; echo"<div class='img'>"; echo"<img src='assets/img/blog/$post_image' alt='Blog'>"; echo"</div>"; echo"<div class='tag'>"; echo"<a href='#'><span class='icon'><i class='fas fa-tags'></i></span> Business</a>"; echo"</div>"; echo"</div>"; echo"<div class='cont'>"; echo"<h6><a href='blog-single.html'>$post_title</a></h6>"; echo"<p>$post_content</p>"; echo"<div class='info'>"; echo"<a href='#'><span class='author'><img src='assets/img/blog/4.png' alt='Post'></span>$post_user</a>"; echo"<a href='#' class='right'><span class='icon'><i class='fas fa-clock'></i></span> $post_date</a>"; echo"</div>"; echo"</div>"; }else { $count=0; echo"<div class='post-img'>"; echo"<div class='img'>"; echo"<img src='assets/img/blog/$post_image' alt='Blog'>"; echo"</div>"; echo"<div class='tag'>"; echo"<a href='#'><span class='icon'><i class='fas fa-tags'></i></span> Business</a>"; echo"</div>"; echo"</div>"; echo"<div class='cont'>"; echo"<h6><a href='blog-single.html'>$post_title</a></h6>"; echo"<p>$post_content</p>"; echo"<div class='info'>"; echo"<a href='#'><span class='author'><img src='assets/img/blog/4.png' alt='Post'></span>$post_user</a>"; echo"<a href='#' class='right'><span class='icon'><i class='fas fa-clock'></i></span> $post_date</a>"; echo"</div>"; echo"</div>"; } $count++; } echo"</tr></table>"; ?> this is the result i want this kind of result thank you
  4. Got it... my mistake.. calling wrong function syntax
  5. Hi guys I AM NEW TO PHP AND MYSQLI... TRYING TO CALL FUNCTION BUT I GOT ERROR CANT FIGURE OUT WITH IT IS, THANKS FOR HELP ME functions.php <?php function Updatepost(){ global $db; $query = "UPDATE posts SET title='Yo me quiero casar con gloria', body='Me gusta el 69' WHERE id=3"; $result = mysqli_query($db, $query); if(!$result){ echo mysqli_error($db); } else{ echo "updated row sucessfully"; } } ?> Index.php <?php include("includes/db.php"); include("functions/functions.php"); ?> <?php function Updatepost(); ?> ERROR Parse error: syntax error, unexpected ';', expecting '{' in C:\wamp64\www\gloria-blog\index.php on line 9 THANKS
  6. hi guys i cant edit my data... what is my error <?php // get value of id that sent from address bar $menu_id=$_GET['menu_id']; // Retrieve data from database $sql="SELECT * FROM menus WHERE menu_id='$menu_id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result) ?> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <form name="form1" method="post" action="update_ac.php"> <td> <table width="100%" border="0" cellspacing="1" cellpadding="0"> <tr> <td> </td> <td colspan="3"><strong>Update data in mysql</strong> </td> </tr> <tr> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> <td align="center"> </td> </tr> <tr> <td align="center"> </td> <td align="center"><strong>Menu name</strong></td> </tr> <tr> <td> </td> <td align="center"> <input name="menu_name" type="text" id="menu_name" value="<? echo $rows['menu_name']; ?>"> </td> <td> </td> <td align="center"> <input type="submit" name="Submit" value="Submit"> </td> <td> </td> </tr> </table> </td> </form> </tr> </table> <?php // close connection mysql_close(); ?> error said:_ notice: Undefined index: menu_id in C:\wamp\www\sparklenshine2\admin\edit.inc.php on line 4 the tablet is: menu_id | menu_name
  7. i found this class to use it <?php class Cleaner { var $stopwords = array(" find ", " about ", " me ", " ever ", " each ", " update ", " delete ", " add ", " insert ", " where ", " i ", " a ", " my ");//you need to extend this big time. var $symbols = array('/','\\','\'','"',',','.','<','>','?',';',':','[',']','{','}','|','=','+', '-','_',')','(','*','&','^','%','$','#','@','!','~','`'); function parseString($string) { $string = ' '.$string.' '; $string = $this->removeStopwords($string); $string = $this->removeSymbols($string); return $string; } function removeStopwords($string) { for ($i = 0; $i < sizeof($this->stopwords); $i++) { $string = str_replace($this->stopwords[$i],' ',$string); } return trim($string); } function removeSymbols($string) { for ($i = 0; $i < sizeof($this->symbols); $i++) { $string = str_replace($this->symbols[$i],' ',$string); } return trim($string); } }
  8. no,,, look for the stop words in the text, echo them back, (so like this you can delete manually or using any function to erase it) before enter to database.
  9. Some search engines don't record extremely common words in order to save space or to speed up searches. These are known as "stop words."
  10. Hi guys, thank so much for all your help. I have this question: I have a two tables one is a content text, and the other one there are the stop words. I would like to match my content with those stop words and echo them, before submit to db. content stopwords content_id words content any suggestion thank you
  11. Hi guys... please review my website. I appreciate your comments. www.sparklenshinecs.com
  12. ok thank you very much, i really appreciate your help. thank you thank you
  13. thank you, i re-wrote the code....this is what i have now <?php $menu_id = $_GET['cat']; $sql = mysql_query("SELECT * from paginas WHERE menu_id=$menu_id"); if(mysql_num_rows($sql)>0) { while($row = mysql_fetch_array($sql)) { $title = $row['title']; $sub_title = $row['sub_title']; $content = $row['content']; $title_tag= str_replace(' . ',' | ',$row['title_tag']); $keywords= $row['keywords']; $description= $row['description']; echo "<title>$title_tag</title>"; echo"<meta name='keywords' content='$keywords'>"; echo"<meta name='description' content='$description'></br>"; } echo"<h1>$title</h1>"; echo"<h2>$sub_title</h2>"; echo"<p>$content</p>"; } else { echo "No results found!"; } ?> what you think?
×
×
  • 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.