Note that there are some explanatory texts on larger screens.

plurals
  1. POAccessing SQL Database from a seperate directory
    primarykey
    data
    text
    <p>I am coding a website which links into the service desk software that I am using. The name of the service desk package is OTRS. The name of the parent directory for the software is named"OTRS", within this directory there are 3 directories "Apache", "mysql" and "OTRS". OTRS holds the .pl files associated with the service desk software. "mysql" holds the databases for the OTRS and any custom database that are created. The "Apache" directory holds custom user-made webpages.</p> <p>Within the "Apache" directory under "htdocs" I would like to create a page which displays how many open tickets are in the service desk. So far I have written the following:</p> <pre><code>&lt;body height: 100%; width: 490px;&gt; &lt;?php //mysql conector $con = mysql_connect("localhost","otrs","xxxxxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("dashboard", $con); ?&gt; &lt;div id="hig9tv"&gt; &lt;center&gt;&lt;p&gt; &lt;table id='higtable2' border="1" cellspacing="2" cellpadding="2"&gt; &lt;?php $result = mysql_query("SELECT * FROM news"); $num=mysql_numrows($result); $i=$num-1; while ($i != -1) { $f1=mysql_result($result,$i,"text"); $f2=mysql_result($result,$i,"time"); $f3=mysql_result($result,$i,"date"); ?&gt; &lt;tr&gt; &lt;td&gt;&lt;font face="Arial, Helvetica, sans-serif"&gt;&lt;?php echo $f1; ?&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td width='80px'&gt;&lt;font face="Arial, Helvetica, sans-serif"&gt;&lt;div id="tiny"&gt;&lt;?php echo "$f3 $f2" ; ?&gt;&lt;/div&gt;&lt;/font&gt;&lt;hr&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php $i--; } ?&gt; &lt;/table&gt; &lt;/p&gt;&lt;/center&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>However nothing is displayed in the div when I open the page. The data is stored in the "mySQL" directory under </p> <blockquote> <p>mysql/data</p> </blockquote> <p>is there anyway to link into the database stored in this directory from the Apache?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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