Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-03-19 16:45:15

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 252
Website

How to create table and add row

Hello,
sorry I’m pretty php-agnostic, I need to generate a table (if not exists) and insert a row of data coming from a $_POST in the article page. The data would be sanitized, I’m wondering what are the built-in functions to do such a thing…

Thanks!

Offline

#2 2012-03-19 17:03:42

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 252
Website

Re: How to create table and add row

I’d say

$phonenumber = doSlash(ps('phonenumber'));
$age = doSlash(ps('age'));
$res = safe_insert('txp_mytable', "phonenumber=$phonenumber, age=$age");

For the insert part…

Offline

#3 2012-03-20 11:45:25

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

Re: How to create table and add row

hi Manaus

try the plugin mem_simple_form it will do the job correctly.

Offline

Board footer

Powered by FluxBB