Ciao a tutti, sono nuovissimo di questo forum...
Ho un problemone con una pagina web del sito che sto ultimando e confido nella vostra eccellente competenza in materia sperando di trovare una soluzione!
Ringraziandovi anticipatamente della vostra disponibilità, vi sottopongo il mio problema:
Ho creato una pagina con 2 righe da compilare e un tasto per inviare i dati con il seguente codice:
<div class="column1-unit" align="center">
<div class="contactform" align="center">
<form method="post" action="{$script_url}?act=key">
<fieldset><legend> {$user.name}'s MALL POINTS DELIVERING SISTEM </legend>
Please enter here the key gonna active now:</p>
<input type="text" name="act_key" id="act_key" class="bigfield" value="{$form_key}" tabindex="1" /></p>
Please enter here the point's quantity:</p>
<input type="text" name="points" id="points" class="bigfield" value="{$form_points}" tabindex="2" /></p>
<input type="submit" id="submit" class="button" name="a_key" value="Submit"></p>
</fieldset>
</form>
</div>
</div>
Riferito alla seguente pagina key.php che dovrebbe prendere i dati inseriti in precedenza e scriverli in un database sql (database WEBSITE, tabella item_key)
qui vi posto il codice relativo nel key.php:
if (isset($_SESSION['aid']))
{
if (isset($_POST['a_key'])) {
$act_key = trim((isset($_POST['act_key']) ? $_POST['act_key'] : ''));
$points = trim((isset($_POST['points']) ? $_POST['points'] : ''));
$actkey = doQuery("INSERT INTO item_key (act_key,wasted,points) VALUES ('$act_key','0','.$points.')", DATABASE_WEBSITE);
if(mssql_num_rows($actkey) == 0) LINEA 37
{
$oSmarty->assign('message', array( 'type' => 'error',
'messages' => array( 'Error key' ) ) );
}
else
{
$oSmarty->assign('message', array( 'type' => 'ok',
'messages' => array( 'Your key has been succesful actived!' ) ) );
}
}
}
else
{
$oSmarty->assign('message', array( 'type' => 'error',
'messages' => array( 'Please log-in to acces this feature!.' ) ) );
}
Però quando provo a compilare i campi nella mia pagina web e premo register ottengo il seguente errore:
Warning: Wrong parameter count for mssql_num_rows() in C:\xampp\htdocs\sitopower\pages\mall\inc.key.php on line 37
e i dati non vengono scritti nella mia tabella SQL... Qualcuno saprebbe dirmi dove sbaglio?
Grazie Matteo