Using a variable in the 'where' clause
-
[insert_php]
global $current_user;
get_currentuserinfo();
echo ‘Student First Name: ‘ . $current_user->user_firstname . “\n”;
echo ‘Student Last Name: ‘ . $current_user->user_lastname . “\n”;
echo ‘Username: ‘ . $current_user->user_login . “\n”;
echo do_shortcode(‘[gdoc key=”https://docs.google.com/spreadsheets/d/1-KJLj2qO9Li-NflQp6SOUEur-aFMCm30ROjjY-wYA10/edit?usp=sharing” use_cache=”no” query=”select A,C where A starts with $current_user->user_login”]’);
[/insert_php]Trying to build a gradebook for an e-learning site. The where clause works without issue inside the inline google sheet shortcode when I use a hardcoded value. However when I try the above code, I get a data table error that says ‘requested unknown parameter ‘1’ for row ‘0’…
Thanks for any help!
https://ww.wp.xz.cn/plugins/inline-google-spreadsheet-viewer/
The topic ‘Using a variable in the 'where' clause’ is closed to new replies.