This topic is locked

Using the Events Database to build a songlist for a wedding.

3/24/2012 12:52:05 PM
PHPRunner General questions
B
broschats author

Here is what I want this project to do.

My thought is to use the events template and it's security for log in.

  1. The user should sign in
  2. Then Search for a date to see if it has a wedding assigned to it.
  3. Then I would like for a user to create an event "like a wedding?"
  4. Then user should search for and select songs to add to their wedding

    reception playlist. The source of song titles will come from an imported

    CSV file and the users updates should be preserved for next login so user can resume

    adding to their list.
  5. The user will eventually e-mail the list in a report.
    I would like to integrate the calendar template functionality with the event template data.

    Be able to update events and calendar data simultaneously.
    I am thinking that PHPrunner is my best chance to getting this done quickly.

    or is this beyond the capabilities of PHPrunner?
    Hmm Think Im gonna need to do some kinda select insert and use cookie info?

    As user admin, I have imported the song database successfully and populated it with 24000+ titles and I am able to sort them and select them.

    Now it is time to try to figure out how to create a list of selected tunes that can be edited by the selecting user. Note that the selecting user will not be admin.

    I Want the selecting user to be logged in with his username and see his event information and the songlist that I imported while using the admin account

    and be able to update and export his earlier selected records in future log ins. Here are three records from song list.
    Should I and How Can I restrict edit to most fields in the song database but allow some to be edited and populated.

    Do I lock a Database or Table and Somehow make editable certain fields only, NAH! SHould I export selected records to a new table associated

    with that users id or cookie? I THINK SO, But what do you think?

    Is there anybody out there.

    <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=19280&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />

B
broschats author 3/24/2012

This empty reply should be deleted. I dont think I have Delete Privs..

Sergey Kornilov admin 3/25/2012

You can definitely build this using PHPRunner. My best advise is to start building it and on the way you can figure out and ask more specific questions.
In regards to making certain fields editable - you can select editable on 'Choose fields' screen in PHPRunner.

B
broschats author 3/26/2012



You can definitely build this using PHPRunner. My best advise is to start building it and on the way you can figure out and ask more specific questions.
In regards to making certain fields editable - you can select editable on 'Choose fields' screen in PHPRunner.


Well, Many attempts to reinvent the wheel compel me to present this problem.

For some reason this is not updating the username field in my evsongspicked table
global $conn;

$strSQLInsert = "insert into evsongpicks (title, artist, picked, username, songnote) values ('".$values["title"]."','".$values["artist"]."','".$values["picked"]."','".$keys["ID"]."','".$values["songnote"]."')";

db_exec($strSQLInsert,$conn);
But SUCCESS? Hmm Nope

THis updated the field. After I added the ID fields to my evsongs and evsongpicks and then made relationships between evusers ID as master to the ID on each of the tables mentioned. Now ID field is populated with a 0 regardless of the user signed in and picking songs.
global $conn;

$strSQLInsert = "insert into evsongpicks (title, artist, picked, ID, songnote) values ('".$values["title"]."','".$values["artist"]."','".$values["picked"]."','".$values["evusers.ID"]."','".$values["songnote"]."')";

db_exec($strSQLInsert,$conn);
Can you see any issues with this method? Ha, I feel like I earned my title today.

Sergey Kornilov admin 3/27/2012

The typical suggestion is to print your SQL Query on the page instead of executing it. Once you have the query run it against your database manually using phpMyAdmin or Navicat. This way you can see more detailed error message and fix your query.
To print your query use

echo $strSQLInsert;


Most probably this is something related to mismatched or missing commas, parenthesis and quotes.

B
broschats author 3/27/2012



The typical suggestion is to print your SQL Query on the page instead of executing it. Once you have the query run it against your database manually using phpMyAdmin or Navicat. This way you can see more detailed error message and fix your query.
To print your query use

echo $strSQLInsert;


Most probably this is something related to mismatched or missing commas, parenthesis and quotes.


I am starting Clean in Debug Mode. I will post an update soon. Thanks

C
cgphp 3/27/2012

If the ID field is an int, rewrite the query as follow:



global $conn;

$strSQLInsert = "insert into evsongpicks (title, artist, picked, ID, songnote) values ('".$values["title"]."','".$values["artist"]."','".$values["picked"]."',".$values["evusers.ID"].",'".$values["songnote"]."')";

db_exec($strSQLInsert,$conn);


I have removed the single quote for the $values["evusers.ID"] value.