i have manage to insert my checkbox array data into database. the problem is when i check multiple checkbox only the first data in array is inserted in database. i need when i check multiple checkbox, all the data i have check insert into database.can someone help me? this is my php code: <?php include ('connect.php'); $cat = implode(',', $_POST['check']); if(isset($_POST['submit'])) { for($i=0; $i<count($cat);$i++) { $p_id =$_GET ['sitter']; $price = $_POST ['price']; $pickup_date =$_POST ['pickup_date']; $dropoff_date =$_POST ['dropoff_date']; $numdays = $_POST ['numdays']; $total =$_POST ['test']; $sql2 = "INSERT INTO cat_sitter(sitter_fk,cat_fk, price, date_in, date_out,total_day, total)VALUES ('$p_id','" . $cat[$i] . "','$price','$pickup_date','$dropoff_date','$numdays', '$total')" …

Member Avatar
Member Avatar
+0 forum 1

hello, I am trying to write a vb.net programme that reads data from a file and do a count for each column as shown in the format below and also write to an output file. i am able to do the count but i am unable to write the output base on the resturants & days. From what i have, i can only write the total sum from the array index. Here is the format of the file for better understanding and what i have done so far. Note; treat me as a newbie **File Format** is 001,1,5,6,21 001,1,5,6,21 001,1,5,6,21 …

Member Avatar
Member Avatar
+0 forum 1

Magento : Using app/design/frontend/default/theme/template/catalog/product/view.phtml how to display my text message on my selected products, workout : <?php $productId = '42150'; $product = Mage::getModel('catalog/product')->load($productId); if( $productId == '42150' ) { echo "Test"; } ?> if i wrong pls correct me.

Member Avatar
+0 forum 0

i need to read from file two array with two different type (string and intger) but when i wrote the c code to read the file : char ON[row][30]; int RA[row][clo]; int i; int j; FILE*infile; infile=fopen("rane.txt","r"); for(i=0; i<row; i++) { fscanf(infile,"%s",&ON[i]); for (i=1;i<row;i++) for(j=0; j<clo; j++) fscanf(infile,"%d",&RA[i][j]); } then when i whant it to print it print something like that : 4740024 -61223616 504492512 how i could solve this problem?

Member Avatar
Member Avatar
+0 forum 1

Input: grid[][] = {"axmy", "bgdf", "xeet", "raks"}; Output: Yes a x m y b g d f x e e t r a k s Input: grid[][] = {"axmy", "brdf", "xeet", "rass"}; Output : No The general idea of what output should be. I have already coded the grid: # include <stdio.h> # include <math.h> # include <stdlib.h> int x; int y; char grid [10] [10]; int z; int j; int main() { // declare array with alphabet char alphabet[26] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', …

Member Avatar
Member Avatar
+0 forum 14

HI All I am displaying 10 questions randomly , if user play quizz multiple times - i want to display updated score of the users's session. demo url is : http://telugumirchi.com/quiz/ **index.php** <?php session_start(); ?> <?php require 'config.php'; ?> <!DOCTYPE html> <html> <head> <title>ABCD COMPANY</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="css/style.css" rel="stylesheet" media="screen"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="../../assets/js/html5shiv.js"></script> <script src="../../assets/js/respond.min.js"></script> <![endif]--> </head> <body> <header> <p class="text-center"> Welcome <?php if(!empty($_SESSION['name'])){echo $_SESSION['name'];}?> </p> </header> <div class="container"> <div class="row"> <div class="col-xs-14 …

Member Avatar
+0 forum 0

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in C:\Users\USER\Desktop\Final Year Project\XAMPP\htdocs\littleavenue\shop.php on line 320 <?PHP if(!isset($_GET['product_category'])){ if(!isset($_GET['category'])){ $per_page = 6; if(isset($_GET['page'])){ $page = $_GET['page']; } else { $page = 1; } $startfrom = ($page-1) * $per_page; $getproducts = " SELECT * FROM products OREDR BY 1 DESC LIMIT $startfrom, $per_page"; $runproducts = mysqli_query($connection,$getproducts); ////LINE 320 //// while($row = mysqli_fetch_array($runproducts)){ ////LINE 320//// $productid = $row['product_id']; $producttitle = $row['product_title']; $productprice = $row['product_price']; $productimgone = $row['product_img1']; echo "<div class='col-md-4 col-sm-6 center-responsive' > <div class='product' > <a href='productdetails.php?product_id=$productid' > <img src='admin/product_images/$proproductimgone' class='img-responsive' > </a> <div class='text'> <h3><a href='productdetails.php?product_id=$productid'>$producttitle</a></h3> <p class='price'>$ $productprice</p> …

Member Avatar
Member Avatar
+0 forum 1

Hi i am trying to fetch data from database into my dropdown menu in codeigniter, but havind error of 'undefined variable: unit_name' . this is my model file `public function get_unit_value() { $result = $this ->db ->select('id, unit_name') -> get('units') -> result_array(); $unit_name = array(); foreach($result as $r) { $unit_name[$r['id']] = $r['unit_name']; } $unit_name[''] = 'Select unit...'; return $unit_name; }` this is my controller `public function unit(){ $this->load->database(); $this->load->model('client_model'); $data['unit_name'] = $this ->client_model-> get_unit_value(); $this -> load -> view('add_quote', $data); }` this s my view file `<div class="panel panel-default"> <div class="panel-heading">The form</div> <div class="panel-body"> <!--dropdown input--> <?php echo form_dropdown('unit_name',$data['unit_name'], '', …

Member Avatar
Member Avatar
+0 forum 1

Can we work with 3D matrices in Pandas?

Member Avatar
Member Avatar
+0 forum 2

Hiya, looking for some help on this bit of code: def save(x,y,z): user=x yourinventory=y score=z allinvent=[] allscore=[] with open("Inventory.txt","r+")as inventory: for line in inventory: allinvent.append(line.strip().split(',')) allinvent.append("\n") for line in allinvent: if (line[0]==yourinventory): allinvent.append(yourinventory) allinvent.pop(line[0:8]) print(allinvent) break inventory.append(allinvent) inventory.close I'm currently working on saving things like inventory, and I'm not sure what I need to use instead of append as I keep getting this error. Traceback (most recent call last): File "\\file1\Student-homes\Intake15\15QuintonSA\My Documents\Year 10\Computer Science\.Adventure Quest v2\main file.py", line 192, in <module> save("pandatron03", invent, 8) File "\\file1\Student-homes\Intake15\15QuintonSA\My Documents\Year 10\Computer Science\.Adventure Quest v2\main file.py", line 19, in save inventory.append(allinvent) `AttributeError: '_io.TextIOWrapper' object …

Member Avatar
+0 forum 0

Hello, i need your help. I need to make a program which will make sum of digits in number e.g. 123 is 6 BUT, the number could be very big like 1000 digits long or more.(e.g. 1 005 854 684......) - of course without spaces So, i cannot use datatypes like unsigned long long int, because of it is not enough. Well, my idea is to store a number into string, then i have to make calculations to make sum of digits. So, my question is: Is it better to use string (char array) or Int array? Do i need …

Member Avatar
Member Avatar
+0 forum 3

Design a computer software application that reads a data file containing the homework grades for a student. Your program must calculate the average homework grade for that student and also display the highest and lowest grades that were read from the data file. Create a pseudocode design for a computer program with the following specifications. Specifications Read a data file containing all of the homework grades for a student Calculate and display the average homework grade Keep track of and display the lowest grade that was read from the file Keep track of and display the highest grade that was …

Member Avatar
Member Avatar
+0 forum 2

So given the following code (not my actual code since it would add unnecessary lines): typedef struct block{ int a; int table[64]; }block; typedef block* block_ptr; void getValues(block_ptr node){ int i, j; for(i=0; i<5; i++){ for(j=0; j < 15; j++){ node[i].table[j] = j; } } } int main(){ block node[10]; getValues(node); printf("%d\n", node[4].table[2]); return 0; } Why does it print out garbage values instead of, in this case, 2? And how can I fix this issue? Thank you for your time.

Member Avatar
Member Avatar
+0 forum 1

I have a webpage which helps download files from database. I want to count the how many times the download button has been clicked and display it on my webpage with unique id. This is my download webpage <div class="container"> <div class="row"> <div class="col-12"> <div class="media"> <img src="./images/<?= $mainImage; ?>" alt="PowerBeatz" width="300" height="300" /> <div class="media-body"> <h5 class="mt-0"><span class="title"><?php echo $row['song']; ?></span></h5> <?php echo $row['artist']; ?> <div class="play"> <a href="file.php?id=<?php echo $row['song_id']; ?>" class="btn btn-primary"><i class="fa fa-download"></i> </a> </div> <div> <p>Total Downloads: </p> </div> </div> </div> </div> </div> </div>

Member Avatar
Member Avatar
+0 forum 2

I am testing my Library class and the addItem method is not adding an item to the arraylist import java.util.ArrayList; public class Library { /** * itemList contains the List of all items in the library. */ private ArrayList<Item> itemList = new ArrayList<Item>(); Item item = new Item(); // Empty Constructor public Library(){} /** * Add a new item to the list of library items. * @param newItem The new item to be added to the list. */ public void addItem(Item newItem) { itemList.add(newItem); } The testDriver has this method Library str = new Library(); ArrayList itemList = new ArrayList(); …

Member Avatar
Member Avatar
+0 forum 1

I'm new to Java and I'm trying to recreate a simplified version of the Game of Mastermind. I managed to allow the player to input once but then it stops. I don't know how to fix this, I've tried everything I knew how to do to fix this but I was unable to. My verification checker also doesnt work import java.util.*; public class Main{ public static void printRed(String a) String red = "\033[31m"; System.out.print(red + a); public static void rules() String reset = "\u001B[0m"; System.out.println(""); System.out.println("The Mastermind Game"); System.out.println(" - How to Play - "); System.out.println("* The goal is to …

Member Avatar
Member Avatar
+0 forum 2

# Lab Assignment # We must create a program that will print a sorted list of all the students and the corresponding scores listing the highest score first and the lowest score last. In this case I would need a Bubble Sort. ## Question ## This is my "Bubble Sort" method shown in the code block below. public static void bubbleSort(String [] name, double [] score) { double temp; int counter; int index = 0; for(counter = 0; counter < score.length - 1 - counter; index++) { if(score[index] > score[index + 1]) { temp = score[index]; score[index] = score[index + …

Member Avatar
Member Avatar
+0 forum 6

# Lab Question# We must create a program that do the following: Allow the user to type in a student name the coorosponds with the student's exam score. The program will be able to accpet exam scores till the user types in the phrase "allDone". The code will determine which student has the highest score and give the name and the score to the user. Here is an example of what will be shown in the console.... *Sample Input* Bob 82 Mary 90 James 87 alldone *Sample Output* Mary has the highest score. Her score is: 90. ## Question ## …

Member Avatar
Member Avatar
+0 forum 6

I am in a Computer Science Class and need help with the following Lab Assingment (WARNIG: this entry may be unintentionally long): # Lab Question # We must create a program that will do these three things: (1) Allow the user to type in a student name the coorosponds with the student's exam score. The program will be able to accpet exam scores till the user types in the phrase "allDone". (2) The code will determine which student has the highest score and give the name and the score to the user. (3) Lastly, the code must print a sorted …

Member Avatar
Member Avatar
+0 forum 2

I have a text file with the following contents: Andrew Law 32 6'1 123 Pounds Tom Harris 19 5'5 180 Pounds Randy Poffo 45 5'3 141 Pounds Now on my form i have a listbox and four labels. What i would like to do is have the listbox show only the names of the people in the text file (Andrew Law, Tom Harris, Randy Poffo) and when the user clicks the persons name in the listbox i would like each of the labels to show the corresponding details for that person (one label showing age, one showing their height and …

Member Avatar
Member Avatar
+0 forum 2

HEEY EVERYONE ,hope you're doing well my teacher assigned us a homework wich is to create a program with C; this program takes as input a text file with some data in it .every line of the text file contains the ID of an employee and it's name and salary e.g 1 katy oath 100.34 22 bob jazy 3343.00 4 jonathan sayf 2000.00 and so on then sort them according to salary o the employee with the highest salary shold be at the firt ,so it should be like this : 22 bob jazy 3343.00 4 jonathan sayf 2000.00 1 …

Member Avatar
Member Avatar
+0 forum 1

Hi i am new to java and just learning as i go , I the basic of calling mothod arguments and so forth but i am having difficulties calling my array method so it would come up to the terminal to the user when the code is running . i have declared the array list paramter to ( int [] name ) , then called the array MyObject.MyMethod ( 01234 ) . I tried to return the array list then call the method that way but is not worrking please can some one show me the correct way to implement …

Member Avatar
Member Avatar
+0 forum 11

#include <iostream> #include <cstdlib> #include <fstream> #include <ctime> using namespace std; void array(int arr[], int arrSize); void add(int arr[], int arrSize, int newElem); bool edit(int arr[], int arrSize, int index, int newVal); bool delEm(int arr[], int arrSize, int elem); bool search(int arr[], int arrSize, int elem); bool PunoNa(int arr[], int arrSize); void display(int arr[], int arrSize); void dispPo(int arr[], int arrSize, int index); void shuffle(int arr[], int arrSize); void loc(int arr[], int arrSize,int elem); int main(){ int choice = 0; int arrSize; cout<<"Enter size of array: "; cin>>arrSize; int arr[arrSize]; if(arrSize<=20){ for(int x=0; x<arrSize; x++){ cout<<"Enter elem"<<x+1<<": "; cin>>arr[x]; } …

Member Avatar
Member Avatar
+0 forum 2

[[Depths (Made with Processing)](https://www.ktbyte.com/projects/project/94051/depths?ref=20181210daniweb)](null)

Member Avatar
+1 forum 0

im just new on c program can you help me on this ? problem : make a C program that will ask 10 numbers and store into an array. the numbers to be entered must be between 70 to 95 only output the average,number of grades below average, above average. if more grades are below average , will display " review your lesson" else " proceed to next chapter "

Member Avatar
Member Avatar
+0 forum 3

I got an Assignment to sort a Randomized Dynamic 2D Matrix of Integers , Snake style : for Example : biggest number in row 0 , after it follows (beneath it , vividly) the next number : 1 2 3 4 5 10 9 8 7 6 11 12 13 1415 20 19 18 17 16 21 22 23 24 25

Member Avatar
Member Avatar
+0 forum 2

Hi there I am new at this website thanks for every one that help me I have this output appear on the link below: [Click Here](https://ibb.co/fe8Cvf) I want to while I choosing a **Time** **value** this value must be send for these useres that **absence** row the checkbox is **checked** this is my code: $s_id=$_POST['s_id']; $date=$_POST['datee']; $time=$_POST['time']; for($i=0;$i<$num_rows;$i++) { $insert="INSERT INTO table(id,s_id,date,time) VALUES(null,'$s_id[$i]','$date','$time')"; mysqli_query($con,$insert) or die(mysqli_error($con)); }

Member Avatar
Member Avatar
+0 forum 3

I need help that how to make these assignment by html,javascript?? i have made admin and user login ..need codes for further more.. **description of assignment:** Salemanagementsystem have two panels.Admin login with specific id and Admin have rights to update product lists add, delete and update. Employees can create new account and login with register email. Employees can search and sale over products via sale button sales products can store in an array which display sales pages. Sales page can see admin and employees but only admin have a rights to restore or delete sales products. Use local storage to …

Member Avatar
+0 forum 0

i am creating an app with android studio and i'm using mySQL.and i want to implement friends feature in my app to enable users send and recieve friend requests, i have created tables and writen the server side php code for that, i have also created an add as friend button that should do that in my app but i'm still unable to write the appropriate code for that in android.your help with this will be highly appreciated.

Member Avatar
Member Avatar
-2 forum 3

Hi all, I need to read a text file (I've attached it, you can take a look), and then store all the numbers in it into a 2D array. After which, I need to parse it. I need urgent help here! ):

Member Avatar
Member Avatar
-2 forum 49

The End.