Jump to content

How to do this function?


coder9

Recommended Posts

ok i have this simple grid table below

http://czone01.com/zodesk/paradiseclicks/tablegrid.php

 

when you click each cell number for instance.

it will store the number into variable --> $link

 

now i'm trying to create a function that will insert it into the table

which has the same column number name of the table from 1 to 100.

 

table

|cid|user_box1|user_box2|user_box3|user_box4|user_box5|user_box6|user_box7|user_box8|user_box9| and soon...

--------------------------------------------

|1  |    |    |    |    |    |    |    |    |    |

 

 

so when i click number 9 cell on the table grid for instance it should store the number 9 (which is stored in $link)

and insert the value of $link (which value 9) into column user_box9 of the table (jtablegrid).

(this is the tricky part, because $link is dynamic and it should find the right column number in the table itself)

 

here is my not finish prototype function,

function store_cell_number(){
//get value of variable link.
//determine what number.
//find the right cell number.
//assign it and insert it into the table
$link = $link;
	$query = "INSERT INTO jtablegrid (_no) VALUES ('$game_no')";
	mysql_query($query);

}

 

Please show me how to insert the dynamic value $link into its right column number that has the same number of $link.

 

THANK YOU!!! very much in advance.

 

 

Link to comment
Share on other sites

Sorry i can't edit my own thread.

 

this is suppose to be my right function prototype.

 

function store_cell_number($link){
     $query = "INSERT INTO jtablegrid ($link) VALUES ('$link')";		
     mysql_query($query);
}

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.