print("".$row["name"]." - ".$_POST["scaf".$row

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SuPeRdUrIk
Forum Newbie
Posts: 2
Joined: Thu Oct 23, 2008 8:45 am

print("".$row["name"]." - ".$_POST["scaf".$row

Post by SuPeRdUrIk »

ciao a tutti :)

Code: Select all

$uploadtypes = sql_query("SELECT id, name FROM categ_add_feat WHERE pid$i111=1 ORDER BY name ASC");     
while ($row = mysql_fetch_array($uploadtypes)) 
$aaaa=print("".$row["name"]." - ".$_POST["scaf".$row["id"].""]."<br />");


can you please tell me how can i save all results of this code

Code: Select all

 
$uploadtypes = sql_query("SELECT id, name FROM categ_add_feat WHERE pid$i111=1 ORDER BY name ASC");     
while ($row = mysql_fetch_array($uploadtypes))


in one $aaaa to insert in it mysql db

because when i write

Code: Select all

$aaaa=print("".$row["name"]." - ".$_POST["scaf".$row["id"].""]."<br />");
i get get the results printed on page

but i need it to be saved as $aaaa and then to insert the results in db

can you give me a tip?? please ....
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: print("".$row["name"]." - ".$_POST["scaf".$row

Post by aceconcepts »

You probably want to take a look at some basic PHP tutorials and/or loops.

However, this is how it could be done - crudely speaking.

Code: Select all

 
$uploadtypes = sql_query("SELECT id, name FROM categ_add_feat WHERE pid$i111=1 ORDER BY name ASC");    
while ($row = mysql_fetch_array($uploadtypes))
{
   $id=$row['id'];
   $name=$row['name'];
 
   //INSERT INTO DB
}
 
SuPeRdUrIk
Forum Newbie
Posts: 2
Joined: Thu Oct 23, 2008 8:45 am

Re: print("".$row["name"]." - ".$_POST["scaf".$row

Post by SuPeRdUrIk »

ok, it is not quite that way , thanks anyway

in upload.php i have this code

Code: Select all

$uploadtypes = sql_query("SELECT id, name FROM categ_add_feat WHERE pid$i111=1 ORDER BY name ASC");
    while ($row = mysql_fetch_array($uploadtypes))
print("<tr><td align=\"right\"><b>".$row["name"]."</b></td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"text\" value=\"scaf".$row["id"]."\" name=\"scaf".$row["id"]."\" size=\"80\" /></td></tr>");
 
AN I HAVE THIS Image

then a need all POSTs from there to save in one $aaaa and insert it to database

in takeupload.php i have the code from first thread

but if i use print i get all results printed on takeupload.php page like this Image


CAN U PLEASE ADVISE ME WHAT DO I NEED TO USE INSTEAD OF PRINT
Attachments
TAKEUPLOAD.PHP
TAKEUPLOAD.PHP
takeupload.php.jpg (47.42 KiB) Viewed 108 times
UPLOAD.PHP
UPLOAD.PHP
x upload.JPG (96.59 KiB) Viewed 108 times
Post Reply