arookie
Posts: 12
|
| Posted: 11/29/2007, 3:10 PM |
|
Hi, this is my problem,... I recieve an url variable: mysite.com?sudent=102|Jose|Suares|109
I must split this variable and save each part in a field (code, name, last_name, grade) on a table (automatically before page shows), and display it in a grid.
I searched the CCS tutorial, google, etc. with no luck...
Thanks,
|
 |
 |
datadoit
|
| Posted: 11/29/2007, 4:01 PM |
|
arookie wrote:
> Hi, this is my problem,... I recieve an url variable:
> mysite.com?sudent=102|Jose|Suares|109
>
> I must split this variable and save each part in a field (code, name,
> last_name, grade) on a table (automatically before page shows), and display it
> in a grid.
>
> I searched the CCS tutorial, google, etc. with no luck...
>
> Thanks,
>
>
> ---------------------------------------
list($field1, $field2, $field3, $field4) = split('|',
CCGetParam("sudent","");
echo "Field1: $field1; Field2: $field2; Field3: $field3; Field4:
$field4";
|
|
|
 |
arookie
Posts: 12
|
| Posted: 11/29/2007, 4:14 PM |
|
Hi, Thanks for your fast response....
I see now how to split the url... but, how I can save each value in it respective field..???
As you can see, Im new in this...
|
 |
 |
datadoit
|
| Posted: 11/29/2007, 7:49 PM |
|
arookie wrote:
> Hi, Thanks for your fast response....
> I see now how to split the url... but, how I can save each value in it
> respective field..???
>
> As you can see, Im new in this... 
> ---------------------------------------
In your page AfterInitialize:
Split out your URL as shown before, then ...
global $DBConnectionDB;
$db = new clsDBConnectionDB();
$sql = "INSERT INTO YourTable VALUES Field1=".$field1.", Field2=".
$field2." WHERE whatever";
$db->query($sql);
$db->close();
|
|
|
 |
arookie
Posts: 12
|
| Posted: 12/04/2007, 8:52 AM |
|
Hi, I really tried to fix this myself, but I couldn.. 
this line list($field1, $field2, $field3, $field4) = split('|',CCGetParam("estudiante",""); sends me an error,
Parse error: syntax error, unexpected ';'
... whats worng...???
|
 |
 |
arookie
Posts: 12
|
| Posted: 12/04/2007, 8:57 AM |
|
I put it in the BeforeShow of the page... is that O.K. ?
|
 |
 |
arookie
Posts: 12
|
| Posted: 12/04/2007, 9:14 AM |
|
Sorry, found the problem, it needed an extre ')'
but now it sends this error:
Warning: split() [function.split]: REG_EMPTY in ...
|
 |
 |
|