Jump to content

williamh69

Members
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

0 Neutral

About williamh69

  • Rank
    Member
  1. williamh69

    update problem

    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
  2. williamh69

    ECHO STOP WORDS BEFORE ENTER TO DB

    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); } }
  3. williamh69

    ECHO STOP WORDS BEFORE ENTER TO DB

    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.
  4. williamh69

    ECHO STOP WORDS BEFORE ENTER TO DB

    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."
  5. 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
  6. williamh69

    Review my website-thank you

    thank you guys
  7. williamh69

    Review my website-thank you

    Hi guys... please review my website. I appreciate your comments. www.sparklenshinecs.com
  8. williamh69

    php and mysql question

    ok thank you very much, i really appreciate your help. thank you thank you
  9. williamh69

    php and mysql question

    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?
  10. williamh69

    php and mysql question

    Hi guys, thank you for all your help i really appreciated. I have my website, www.sparklenshinecs.com, and i am trying to do a SEO on it. However when I run a seo report appears two different lines of code as follow http://www.sparklenshinecs.com/index.php?content=paginas&amp;cat=7 and http://www.sparklenshinecs.com/index.php?content=paginas&cat=7 if I run the first link it gives me the following error on the page: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/10/9601510/html/paginas.inc.php on line 7 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/10/9601510/html/paginas.inc.php on line 38 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/10/9601510/html/paginas.inc.php on line 56 and if I run the second link: it gives me the normal page. Someone can please explain me whats going on, and how I avoid those warnings.
  11. williamh69

    can retrieve the correct data

    <?php $menu_id = $_GET['cat']; $query="SELECT * from paginas WHERE menu_id=$menu_id"; $result=mysql_query($query); while($row=mysql_fetch_array($result,MYSQL_ASSOC)) { $page_id = $row['page_id']; $title = $row['title']; $sub_title = $row['sub_title']; $content = $row['content']; echo "<h1>$title</h1>"; echo"<br>"; echo"<h2>$sub_title</h2>"; echo"<br>"; echo"<p>$content</p>"; } ?> here it is
  12. williamh69

    can retrieve the correct data

    adam i used your code but gives me also the same result
  13. williamh69

    can retrieve the correct data

    hi cyber i tried but t it gives me the same result
  14. williamh69

    can retrieve the correct data

    hi guys i have this two db's menu paginas menu_id page_id name menu_id title content I populate the menu with the following code, which working fine. <?php function query($parent_id) { //function to run a query $query = mysql_query ( "SELECT * FROM menus" ); return $query; } function fetch_menu($query) { while ( $result = mysql_fetch_array ( $query ) ) { $menu_id = $result ['menu_id']; $menu_name = $result ['menu_name']; $menu_link = $result ['menu_link']; echo "<li class='has-sub '><a href='index.php?content=paginas&cat=$menu_id'><span>$menu_name</span></a>"; echo "</li>"; } } fetch_menu (query(0)); //call this function with 0 parent id ?> then I link every menu in my list with each page with this code, but appears the first entry in all the menus, I used the following code: <?php $menu_id = $_GET['cat']; $query="SELECT page_id, title, sub_title, content from paginas where menu_id=$page_id"; $result=mysql_query($query); while($row=mysql_fetch_array($result,MYSQL_ASSOC)) { $page_id = $row['page_id']; $title = $row['title']; $sub_title = $row['sub_title']; $content = $row['content']; echo "<h1>$title</h1>"; echo"<br>"; echo"<h2>$sub_title</h2>"; echo"<br>"; echo"<p>$content</p>"; } ?> what i am doing wrong..... thank you for ur help
  15. williamh69

    dynamic navigation with php from mysql

    <?php function login() { $con = mysql_connect("localhost", "xxxx", "xxxx") or die('Could not connect to server'); mysql_select_db("xxxx", $con) or die('Could not connect to database'); } ?> this is the loging function.... from file called mylibrary
×

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.