WebSite X5Help Center

 
Constantinos L.
Constantinos L.
User

Database results do not appear in the table  en

Autor: Constantinos L.
Visitado 2511, Followers 1, Compartido 0  

In HTML code I have created two drop down lists. Then, using a submit button I send the two selections to an MySQL query. The code accesses my database and the results are presented in a table below the drop down lists. Using the "HTML and Widhget" object I pasted this code. But I can only see the two drop down lists and the submit button. The table does not appear.

Question: How do I get the table to appear in Websitex5?

I have been trying to upload screen shots with this post but I was unable to.  All my attempts to upload a simple zip file failed.  The zip file was only a few k in size comprising only of two jpg images.  I would appriciate it if you can let me know of an email to send you the images as well as the code for your reference.

Thx in advance.

P.S. I am very new in HTML!

Publicado en
14 RESPUESTAS
Constantinos L.
Constantinos L.
User
Autor

Here's another attempt to upload the screen shots and my code.

Leer más
Publicado en de Constantinos L.
Constantinos L.
Constantinos L.
User
Autor

Here's another attempt to upload the screen shots and my code.

Leer más
Publicado en de Constantinos L.
Paul M.
Paul M.
Moderator

Hello Constantinos,

Is the code shown part of a PHP script you have written yourself, or a custom script?  There is obviously some code missing in the screenshot...  can you upload it all, or can you post a link to your website?

Have you changed the file extension of the webpage inside X5 from .html to .php?

Have you checked to ensure your webserver supports the version of PHP which you are using?

Kind regards,

Paul

Leer más
Publicado en de Paul M.
Constantinos L.
Constantinos L.
User
Autor

Hi Paul,

The code is something that I wrote myself.  I am also having trouble using a custom script but let's take it one step at a time and deal with my own script first.

A test link on what I am trying to do is found here http://www.medicsavercy.com/_pl/doctor_list_test.php

I need to somehow incorporate what you see in this test link within my websitex5 site.

I have tried again and again to upload the code but I was refused.  I guess it is an issue of security which is perfectly understandable.  Is there a different way of uploading code within this forum?

No, I did not change any file extensions on the webpage. Should I?

The webserver's PHP version is 5.2.17 and the above test link is on the same folder structure as my website.

Thanking you in advance.

Leer más
Publicado en de Constantinos L.
Paul M.
Paul M.
Moderator

Hello Constantinos,

Any PHP code which you have embedded in a webpage won't be executed unless you first change the file extension of that particular webpage to .php

You do this in Step 2 - Sitemap Creation...  click once on the webpage in question in the 'Map' list to highlight/select it...  then click the 'Properties' button on the right-hand side of the screen... go to the 'Expert' tab in the new screen which opens...  select 'php' from the 'File Name Format' drop-down menu.

Reupload your project to the web server.

Let us know whether or not your script then works as intended.

Kind regards,

Paul

Leer más
Publicado en de Paul M.
Constantinos L.
Constantinos L.
User
Autor

Thx Paul. After following your advice I had a partial success.

Step 1: I pasted my PHP code in the "Expert" tab i nthe page properties using PHP as the file format and using "Before closing the body tag".

Step 2: I added a new HTML/Widget object and in the "HTML code" tab I pasted the drop down lists code.

Step 3: I then clicked on the "Expert" tab of the same object and pasted any styling CSS code I had.

The result is more promising than before. The table does appear but I can only see part of it below right.  In fact it is partialy visible as you can see in the uploaded image.

Why? What do I need to change to get the table to appear correctly? The tables styling is under the "table_style" id and is part of the CSS code visible in the 3rd step uploaded image.

I have zipped screen shots and I hope I will manage to upload them all in one go this time. Otherwise I will post them one by one just like before. Here goes...

Leer más
Publicado en de Constantinos L.
Constantinos L.
Constantinos L.
User
Autor

step 2 image

Leer más
Publicado en de Constantinos L.
Constantinos L.
Constantinos L.
User
Autor

step 3 image

Leer más
Publicado en de Constantinos L.
Constantinos L.
Constantinos L.
User
Autor

result image

Leer más
Publicado en de Constantinos L.
Paul M.
Paul M.
Moderator

Hi Constantinos,

If you look to the bottom right-hand corner of any HTML & Widgets properties screen then you'll notice editable settings for width, height and scrollbars.  It appears as if your two drop-down lists are taking up too much screen space...  i.e. they need to be reduced in height.  So you can adjust this and it should improve things.

However, I would also do the following:

Remove your PHP code from the 'Expert' tab in the Page Properties in Step 2 Sitemap, and paste it instead into a second HTML/Widget in Step 3 Page Creation -  leave the file extension as .php in Step 2 though.

This should then give you greater control over the positioning of the various elements on your webpage.  Note that I haven't tested this as yet, but in theory it should allow you to style the page as you wish.

Keep us posted as to your progress Smile

Kind regards,

Paul

Leer más
Publicado en de Paul M.
Constantinos L.
Constantinos L.
User
Autor

I am getting there with every step. Thx Paul.

There are a few more things though.  In my test link (http://www.medicsavercy.com/_pl/doctor_list_test.php) I have no trouble getting the drop down lists and submit button to be enclosed in a boarder.

But, I do not get the same result when I use the code within websitex5.  Following your last advice I moved the code from the page's expert tab and pasted it under my code for the drop down lists (step 2 image).

As you can see from the uploaded image there are several issues that are different from my test link.  Here's the list:

  1. Submit button spills out of the border.
  2. In CSS the width is set to 100% but the table's width is only half the page's.
  3. In my test code I managed to get the colour to alternate per each row.  The effect is lost here.

I thank you in advance.

Leer más
Publicado en de Constantinos L.
Incomedia
Claudio D.
Incomedia

Hello Constantinos,

For the width check if the obejct is using the whole width on step 3 and for the colors and other settings of your table, some are using settings defined by the program and so you will need to override them with !important after every css code. Since you are working on a project where most css code is already included you will need to use this trick to make it work.

Many thanks!

Leer más
Publicado en de Claudio D.
Constantinos L.
Constantinos L.
User
Autor

I have added "!important" after all my custom css code but there is not change to the spill over (see attached Border spillover.jpg image)

Leer más
Publicado en de Constantinos L.
Incomedia
Claudio D.
Incomedia

Hello Constantinos,

We cannot give support to custom code. You need to check if the code written is correct and follows the css standards with space and ; all in the correct position.

Many thanks!

Leer más
Publicado en de Claudio D.