WebSite X5Help Center

 
Dan N.
Dan N.
User

Contact form object with database  en

Autor: Dan N.
Visitado 1194, Followers 1, Compartido 0  

I use contact form object for to create forms that are connected to a mysql database. That is OK. BUT. First problem is that i want to have dropbox with the name of countries that i want to get from a database. I would like to have like PHP code for example 

"$sql = "SELECT * FROM Country WHERE 1"; $result = mysqli_query($con, $sql);
while ($row = mysqli_fetch_row($result))
{
echo '<option value="'.$row[0].'">'.$row[2].'</option>';
}"

I can do it and it works but I when I go into website x5 and make a change of anything then that page will be overwritten and I have to enter the same code to the same page every time. I would like to pinpoint that code in the page. Or if there is another way to get around it. 

The next problem is that when I have entered all the data to one table then I want to use the ID of that row to be able to make a Entity-Relation between two tables. As i see it that is not possible with WebsiteX5. Or could I in som way enter php code in to the script? 

Publicado en
3 RESPUESTAS - 1 ÚTIL
JJ. JUAG
JJ. JUAG
User

You could adjust the country selection in the language center (country_names and country_codes) so that only the desired countries can be selected.
We use this in the shop.
Where: 1 General settings - Website language - Icon on the right (sheet with pen)


JJ.

The best thing to do is to open one post per question, I can't answer the second question.

Leer más
Publicado en de JJ. JUAG
Dan N.
Dan N.
User

It is not just about the country codes. The point is that I need to make man different forms and depending on a db select statement I would like to go to different forms and enter different into enteties. I need to make forms and connect them to a database Not just enter data to a database but also read and do different things.  

Leer más
Publicado en de Dan N.
Dan N.
Dan N.
User

I have been working on doing my own forms by using JSON. The code reads the JSON file and create the form. Depending on whick form to use I can easily change to different forms. The forms are created oaccording to JSON file struckture and are done so on the fly. My purpose was not to create a software to create forms but to be able to manover beetween different inputs. The webpage have become a more interpreter then the webpage itself. Just like there was once BASIC interpreters. WebsiteX5 is god for static pages but not good for dynamic ones. 

Leer más
Publicado en de Dan N.