What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP/MySQL problem

PHP/MySQL problem
Author: Message:
YottabyteWizard
Senior Member
****

Avatar

Posts: 709
Reputation: 23
37 / Male / Flag
Joined: Mar 2005
O.P. PHP/MySQL problem
I have a problem with some of my first php scripts, hope you can help me out.

I have this really big form (around 200 text fields), so to make things faster and uses the less possible space I'm trying to insert the first text field to a database, then get its ID and start a cycle where the script will keep inserting on each one the information on each text field.

For some reason it's not working.


code:

<?php
error_reporting(E_ALL);
echo "Processing"...

mysql_connect("localhost","username","password") or die(mysql_error());

mysql_select_db("chismografo") or die(mysql_error());

$q = array(5);


for ($cpost=1; $cpost < 6; $cpost++)
{
$q[$cpost]=_POST["T".$cpost];
}

MYSQL_QUERY("INSERT INTO datos (id,q1) VALUES ('NULL', '$q[1]')");
$scriteria=(MYSQL_QUERY("SELECT id FROM `chismografo`.`datos` WHERE q1='$q[1]'"));

for ($postn=2; $postn < 6; $postn++)
{
MYSQL_QUERY("INSERT INTO datos (id,q[$postn]) VALUES ('$scriteria', '$q[$postn]')");
}


echo "Query Finished";
?>



Wohoo, 600th post...

This post was edited on 12-14-2006 at 10:39 PM by YottabyteWizard.
12-14-2006 10:39 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP/MySQL problem - by YottabyteWizard on 12-14-2006 at 10:39 PM
RE: PHP/MySQL problem - by WDZ on 12-15-2006 at 05:40 AM
RE: PHP/MySQL problem - by YottabyteWizard on 12-15-2006 at 06:41 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On