Here is the link to the page: https://www.level1firearms.com/cophptest.php
The SQL table appears in the upper-left side of the page.
The code only works if I paste it at "End of Page" in the page properties or the End of Page setting in the Object <>HTML element.
Placing the code in other areas, such as After Body or Use DIV option causes the page to return completely blank.
What am I missing?
SQL Table Location/Results
SQL Table Location/Results
Last edited by Exiis on Tue Feb 07, 2017 9:39 am, edited 1 time in total.
David Streb
dave@level1firearms.com
dave@level1firearms.com
Re: SQL Table Location/Results
text (where appears the code you insert) / properties / general / advanced -> do not encode html characters (for advanced users only)
(just tick this option and click ok)
besides this, your code seems incorrect and/or incomplete
(just tick this option and click ok)
besides this, your code seems incorrect and/or incomplete
Last edited by [RZ] on Tue Feb 07, 2017 9:39 am, edited 1 time in total.
Re: SQL Table Location/Results
Thanks RZ:
I am not trying to do this with a text object. I'm only using the text object to display the code I'm using to get my database table information. Ideally, I want the table to appear at the end of web page as displayed on the page. .
I am not trying to do this with a text object. I'm only using the text object to display the code I'm using to get my database table information. Ideally, I want the table to appear at the end of web page as displayed on the page. .
David Streb
dave@level1firearms.com
dave@level1firearms.com
Re: SQL Table Location/Results
i edited my post
you see the source code instead of the result because it has been escaped, tick the option i told you
and also your code is not correct, structures not closed, vars not defined to make the proper connection to the database, etc...
you see the source code instead of the result because it has been escaped, tick the option i told you
and also your code is not correct, structures not closed, vars not defined to make the proper connection to the database, etc...
Re: SQL Table Location/Results
Thanks Again RZ:
I don't think I'm communicating the issue correctly. The source code is there for you to see it voluntarily; deliberately.
The results I get from the code appears in the upper-left side of the page - that works perfectly...that is the actual results being produced in real-time with the source code I posted.
What I am trying to do is place those results at the bottom of the page and in the middle.
That's the reason why I posted the source code - to gather some direction on how to move the results to the bottom of the page.
If there are other suggestions for improvement, that would be most welcomed. This is the only "customization" to WYSIWYG I every see I would need to do.
I don't think I'm communicating the issue correctly. The source code is there for you to see it voluntarily; deliberately.
The results I get from the code appears in the upper-left side of the page - that works perfectly...that is the actual results being produced in real-time with the source code I posted.
What I am trying to do is place those results at the bottom of the page and in the middle.
That's the reason why I posted the source code - to gather some direction on how to move the results to the bottom of the page.
If there are other suggestions for improvement, that would be most welcomed. This is the only "customization" to WYSIWYG I every see I would need to do.
David Streb
dave@level1firearms.com
dave@level1firearms.com
Re: SQL Table Location/Results
the code you inserted that apparently works "correct" is not correct and may impact unpredictably on the whole page
Re: SQL Table Location/Results
The code should be placed in HTML object with 'use div '
Note however that your code is not complete. Closing tags are missing.
Please note that I cannot assist you with programming related issues. The code will be inserted "AS IS".
Just make sure all HTML formatting options are set to 'Default' to prevent your code being processed/formatted.
Note however that your code is not complete. Closing tags are missing.
Please note that I cannot assist you with programming related issues. The code will be inserted "AS IS".
Just make sure all HTML formatting options are set to 'Default' to prevent your code being processed/formatted.
Re: SQL Table Location/Results
Pablo:
THANK YOU!
Works as expected. For everyone else, I added:
?>
at the end of the code.
Here is how it is after corrections made:
<div style="visibility:visible;">
<?php
$mysql_hostname = "localhost";
$mysql_user = "";
$mysql_password = "";
$mysql_database = "";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Oops some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Oops some thing went wrong");// we are now connected to database
$result = mysql_query("SELECT * FROM `Denver` WHERE `id` ORDER BY RAND() LIMIT 100"); // selecting data through mysql_query()
echo '<table border=0px>'; // opening table tag
echo'<th>Title</th><th>Url</th>'; //table headers
while($data = mysql_fetch_array($result))
{
// we are running a while loop to print all the rows in a table
echo'<tr>'; // printing table row
echo '<td>'.$data['Subject'].'</td><td><a href="'.$data['Url'].'">'.$data['Url'].'</a></td></td> '; // we are looping all data to be printed till last row in the table
echo'</tr>'; // closing table row
}
?>
THANK YOU!
Works as expected. For everyone else, I added:
?>
at the end of the code.
Here is how it is after corrections made:
<div style="visibility:visible;">
<?php
$mysql_hostname = "localhost";
$mysql_user = "";
$mysql_password = "";
$mysql_database = "";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Oops some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Oops some thing went wrong");// we are now connected to database
$result = mysql_query("SELECT * FROM `Denver` WHERE `id` ORDER BY RAND() LIMIT 100"); // selecting data through mysql_query()
echo '<table border=0px>'; // opening table tag
echo'<th>Title</th><th>Url</th>'; //table headers
while($data = mysql_fetch_array($result))
{
// we are running a while loop to print all the rows in a table
echo'<tr>'; // printing table row
echo '<td>'.$data['Subject'].'</td><td><a href="'.$data['Url'].'">'.$data['Url'].'</a></td></td> '; // we are looping all data to be printed till last row in the table
echo'</tr>'; // closing table row
}
?>
David Streb
dave@level1firearms.com
dave@level1firearms.com