Forums

simple display data

tcole 08 Jun, 2010
I have chrono forms creating the form and database for entering in the data. I am trying to use chronoconnectivity to display the data and get the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SQL: WHERE cf_user_id = 63' at line 1 SQL=SELECT count(*) FROM jos_chronoforms_SchoolDetails WHERE SQL: WHERE cf_user_id = 63

I have tried a few things, but no joy.
Any help would be appreciated.
Cheers
GreyHead 09 Jun, 2010
Hi Terry,

It looks as though you have this code in the WHERE box
WHERE SQL: WHERE cf_user_id = 63
It should just be
WHERE `cf_user_id` = 63

Bob
zhazhago 09 Jun, 2010
how did u get the value 63?
zhazhago 09 Jun, 2010
i mean, 63 should from either the "Post variables" or "Get variables" like following.

[attachment=0]ss1.jpg[/attachment]

In my case, the value is 66.

How to fill these two parts with variables (such as "UserID"),
then, i can put WHERE `cf_user_id` = UserID at WHERE SQL part.
GreyHead 09 Jun, 2010
Hi zhazhago,

I've answered this question from you in another thread.

Bob
zhazhago 09 Jun, 2010

Hi zhazhago,

I've answered this question from you in another thread.

Bob




Thank you
tcole 09 Jun, 2010
Bob,
I have tried with the speech marks, but get the same error.
I have not 'created' the code, the program has.

<?php
$user = &JFactory::getUser();
echo "WHERE cf_user_id = ".$user->id
?>

I want the members to be able to edit their own details.

This is for a sports tournamant. Schools will register with the school details and then using another form enter in team details.
They must be able to update school and team details, but only their own.

Thanks for your help.

PS I have a little experience with php and mysql.
Cheers
zhazhago 10 Jun, 2010
Hi tcole,

I am pretty sure the code is correct.

I used the same code on my website and it works. BTW, seems we are building the website for the same functions.

U may wish to confirm ur CC connects the right table in DB and the user id is stored there.

Best Regards
This topic is locked and no more replies can be posted.