我正在尝试使用这个php文件来输入一个文本字段,以将值依次放在我的表列(q1,q2,q3 ..)上,请帮忙
<?php
for ($i = 1; $i <= 10; $i++) {
$quest = str_replace("1",$i,'q1');
$current_user_id = get_current_user_id();
$answer = $_GET['answer'];
$rows = $wpdb->update(
'wp_1m4ya4r4gg_users',
array(
$quest => $answer),
array( 'ID' => $current_user_id ),
array(
'%s', // value1
'%d' // value2
),
array( '%d' )
);
}
?>
<center>
<iframe name="votar" style="display:none;"></iframe>
<form method="GET" action="" target="votar">
<img id="image" src="http://soulmatelab.com/wp-content/uploads/2019/04/michael-fenton-512963-unsplash.jpg" />
<input type="text" name="answer" type='hidden' ><br>
<input type="submit" value="Submit">
</form>
</center>