Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql and php connection
    text
    copied!<p>friends i'm a beginner to create a database i'm using xampp for creating the database I have added my data's with mysql in xampp but i don't know to connect my mysql with php (for web page) </p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;marquee behavior="alternate"&gt;welcome&lt;/marquee&gt; &lt;/body&gt; &lt;/html&gt; &lt;?php $username = "root"; $password = "root123"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL&lt;br&gt;"; ?&gt; &lt;?php $selected = mysql_select_db("missensencemuttation",$dbhandle) or die("Could not select missensencemuttation"); ?&gt; &lt;?php $result = mysql_query("SELECT * FROM `primary_data` LIMIT 0, 30"); ($row=mysql_fetch_array($result)); { echo "disease_name:".$row{'disease_name'}." gene_name:".$row{'gene_name'}; } ?&gt;enter code here &lt;?php mysql_close($dbhandle); ?&gt; </code></pre> <p>this what i did for connecting my database with php</p> <p>but in the result i can see only my first row of my table I have 10 rows in it. but when I used to connect them I can see only my first row. in my php </p> <h2>can any one help me to connect all my data's in php?</h2> <pre><code>&lt;html&gt; &lt;body&gt; &lt;marquee behavior="alternate"&gt;welcome to the database&lt;/marquee&gt; &lt;table border="3" align="center"&gt; &lt;tr&gt;&lt;th&gt;disase_name&lt;/th&gt;&lt;th&gt;gene_name&lt;/th&gt;&lt;/tr&gt; &lt;?php $username = "root"; $password = "2991"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL&lt;br&gt;"; $selected = mysql_select_db("disease",$dbhandle) or die("Could not select disease"); $result = mysql_query("SELECT * FROM `primary_data` LIMIT 0, 30"); while($row = mysql_fetch_array($result)) { echo "&lt;tr&gt;&lt;td&gt;".$row['disease_name']."&lt;/td&gt;&lt;td&gt;".$row['gene_name']."&lt;/td&gt; &lt;/tr&gt;"; } mysql_close($dbhandle); ?&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <h2> the answer i expected friends comes with this code</h2>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload