473,395 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to receive data from my database in a webpage format

...I don't know if this is the correct or more simplified style of being able to retrieve data from my database (phpmyadmin) and putting it on the browswer. I need assistance to do that.

http://inks-etc.org/SearchEngine/thinker2010.html (or php) can tell you where things are going wrong. I have 9 plus reference books on PHP & MYSQL that are give me direction but I am placing my instruction in a "while loop" that are placing me in a viscous cycle. I need help...


Expand|Select|Wrap|Line Numbers
  1. <?php
  2. include ("thinker2010.html");
  3.  
  4.  
  5. //get data
  6. $button = $_GET['submit'];
  7. $search = $_GET['search_ink'];
  8.  
  9. //if a customer places a keyword into the thinker then...go to the next phase
  10. if($search!="")
  11. {
  12.      /* explode the keywords; the 1st term "" is the way to explode  
  13. and the 2nd term is what your exploding; the $search is the $GET*/
  14.      $search_exploded = explode (" " , $search);
  15.  
  16.  
  17.      // looping
  18.      foreach ($search_exploded as $search_each);
  19.      {
  20.       $x++;
  21.      // if ... this is the 1st time we are looping
  22.       if ($x==1)
  23.      /* the % are wildcards that stand in for any other char. before  
  24.      or afterthe word --- construct query => x++ shows how many time the loop has been thru
  25.      $construct .= is the same as $construct = $construct . "$xyz"*/
  26.        $construct .= "keyword LIKE '%$search_each%'";
  27.      /* else...allow more keywords that are looped by the con't phrase  
  28. OR keywords LIKE that cont over and over again ~ loop  */
  29.       else
  30.        $construct .=  "OR keyword LIKE '%$search_each%'";
  31.      }
  32.  
  33.    /*echo out with the value construct - this is a $query --- FROM is the table WHERE is the column---"SELECT * FROM The_Thinker WHERE $construct";*/
  34.    $construct =  "SELECT * FROM code WHERE MATCH(keyword, url) AGAINST ('$construct')";
  35.    //this is a $result
  36.    $run = mysqli_query(" ", $construct);
  37.    $foundnum = mysqli_num_rows($run);
  38.     if ($foundnum==0)
  39.      echo "Jason No results found.";
  40.     else
  41.     {
  42.      echo "$foundnum results found!";
  43.  
  44.      while ($runrows = mysqli_fetch_assoc($run));
  45.  
  46.       {
  47.        //get data
  48.        $keyword = $runrows ['keyword'];
  49.        $desc = $runrows ['Description'];
  50.        $url = $runrows ['url'];
  51.        echo "<b>$keyword</b><br>
  52.         $desc<br><a href='$url'>$url</a><p>";
  53.       }
  54.  
  55.     }
  56.  
  57.   echo $construct;
  58.   die ();
  59. }
  60.     else
  61.         {
  62.            echo "Kraft No result found.";
  63.         }
  64. ?>
Sep 25 '10 #1
1 1284
Atli
5,058 Expert 4TB
You need to connect to MySQL before trying to send it queries. See the examples in the manual entry for mysqli_query.
Sep 25 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: rafeekb | last post by:
Hello All, Is there any way to export data in the IXF version 1 format from a DB2 v8.2 database ? The problem I am facing is to get the data from a v8.2 database which produces a version 2...
1
by: kanchan | last post by:
Hi, I am writing a client for a real time audio streaming server. I am using pthread for that. I have one thread receiving data on a socket from the server. After buffering some data, other thread...
2
by: Ben | last post by:
Hi I have the two funcions below, login_web that posts data to a webpage and fcn_parseviewstate that parses the viewstate data for the post. I have a problem with the strPostData, I have been...
6
by: shivavrata | last post by:
Hi All, I want to transfer the data form webpage to any other own application which is running in backend.How i develop this web page. which technology is good for this or any particular protocol...
2
by: Lou | last post by:
I have a class that creates an instance of the seril Port. Every thing works fine except whenever I receive data I cannot display the recieved data. I get no errors but the recived data seems to...
2
by: Dhananjay | last post by:
Hi all , I have got problem when i am tring to exportGridview Data into Excel format. It is going into text format ,but what i want is if the field is number/currency then it should go into...
16
by: s0suk3 | last post by:
I wanted to ask for standard ways to receive data from a socket stream (with socket.socket.recv()). It's simple when you know the amount of data that you're going to receive, or when you'll receive...
15
by: Peter | last post by:
I have the following web page and I am trying to have the Field lables NOT to wrap. It looks fine in a designer but when I run the program in a browser the lables that have a space wrap. How do I...
0
by: Claudinei | last post by:
1) I will be receiving a customer number data being stored in a database, where would crypto User Password, and how to test it send the following example. 1.1) Where a need descryptografar...
1
by: sankothari2002 | last post by:
Recently we have connected one bluetooth device which receive data from our serial device. The bluetooth device further transmite this data to a Windows Mobile which is bluetooth enable. Baud rate of...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.