close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Can you store multiple rows with WebAssist?

Thread began 10/03/2014 11:03 am by Poj | Last modified 10/07/2014 11:38 am by Jason Byrnes | 1298 views | 7 replies |

Poj

Can you store multiple rows with WebAssist?

Can you store multiple rows with WebAssist?
I'm building a page where I want to store results from a bowling match. I will pick the players and report the results to be stored as one row in the table. it may be 4 to 9 players.

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, you can use the data assist insert behavior to insert each row into the table.

Sign in to reply to this post

Poj

I have a report page and an action page. Report page I have a form inside keeps a table with 9 rows, I'll pick up the player names from the current match and fill in the score, number of series for each player, then I press the submit button.
When running the action page, which looks like this in MySQL:

<?php require_once('../Connections/test.php'); ?>
<?php mysql_select_db($database_test, $test);

for($i=1; $i<=9; $i++) {
if ($_POST["spelid$i"]>"0") { /* checks that spelid is greater than 0 */
mysql_query( sprintf(
"INSERT INTO team_snitt (spelid,resultat,serier,banp,matchid) VALUES ('%s','%s','%s','%s','%s')",
mysql_real_escape_string($_POST["spelid$i"]),
mysql_real_escape_string($_POST["resultat$i"]),
mysql_real_escape_string($_POST["serier$i"]),
mysql_real_escape_string($_POST["banp$i"]),
mysql_real_escape_string($_POST["matchid$i"])
));
} }

/* mysql_query("DELETE FROM team_snitt WHERE spelid=0 "); */
header("location:lagra_resultat.php");
?>

How do you make this to MySQLi so it fits with the web assistant files?
I can nothing on MySQLi.

Sign in to reply to this post

Jason ByrnesWebAssist

create the MySQLi insert behavior, than add your hand coded for statement around it.

Sign in to reply to this post

Poj

Ok I tried but I rapids not how or where to insert values. There are many $ InsertQuery.
So here was it when I put in mysqli insert a blank page.
<?php require_once('../../Connections/teamet_i.php'); ?>
<?php require_once('../../webassist/mysqli/queryobj.php'); ?>
<?php
if ("" == "") {
$InsertQuery = new WA_MySQLi_Query($teamet_i);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "team_resultat";
$InsertQuery->bindColumn("medlemid", "i", "1", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>
How do I get into the if statement and variables in this? see the code from mysql above
Which trigger to use?

Sign in to reply to this post

Jason ByrnesWebAssist

you need a separate bindColumn statement for each form element, for example:

$InsertQuery->bindColumn("spelid", "i", "".$_POST["spelid$i"]."", "WA_DEFAULT");


and add your for loop around the insert statement. If you need further help in setting this up, please submit a premiere suppport request:
http://www.webassist.com/premier_request.php

Sign in to reply to this post

Poj

Hello. I have no desire to pay $ 99 when I just bought WebAssist for $ 150.
Especially when I took a day's holiday to finish this projectet and could not do anything to the server failed, WebAssist asked for the serial number all the time.
I've been looking on the web and your site for help and examples but not found anything.
Incidentally, I have not got it to work yet, even though I moved around if statement.

Sign in to reply to this post

Jason ByrnesWebAssist

Sorry, but what you are asking about is custom coding and not directly supported, we offer support for custom coding through our premiere support channel.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...