Click here to Skip to main content
15,898,588 members

Comments by Member 15021280 (Top 8 by date)

Member 15021280 6-Nov-22 17:24pm View    
def course_options():
cursor = mysql.connection.cursor()
cursor.execute(''' SELECT course_code, name, college_code FROM course ''')
courses = cursor.fetchall()

options = [ tuple(course.values()) for course in courses]


return options

def college_options():
cursor = mysql.connection.cursor()
cursor.execute(''' SELECT college_code, name FROM college ''')
colleges = cursor.fetchall()
options = [tuple(college.values()) for college in colleges]

return options
Member 15021280 6-Nov-22 17:24pm View    
@student_bp.route('/college_search', methods=["POST", "GET"])
def college_search():
search_form = SearchCollegeForm()
form = CollegeForm()
field = search_form.search_field.data
searchby = search_form.search_by.data
cursor = mysql.connection.cursor()
if(searchby == 'all'):
cursor.execute(''' SELECT * FROM college WHERE college_code REGEXP %s or
name REGEXP %s ''', ([field], [field]))
colleges_data = cursor.fetchall()
if(searchby == 'college_code'):
cursor.execute(''' SELECT * FROM college WHERE college_code REGEXP %s ''', [field])
colleges_data = cursor.fetchall()
if(searchby == 'name'):
cursor.execute(''' SELECT * FROM college WHERE name REGEXP %s ''', [field])
colleges_data = cursor.fetchall()
flash("Search results for \" {} \"".format(field),
"success")
return render_template('college/view_colleges.html',
colleges_data=colleges_data,
search_form=search_form,
form=form,
title='Search Results')


def course_options():
cursor = mysql.connection.cursor()
cursor.execute(''' SELECT course_code, name, college_code FROM course ''')
courses = cursor.fetchall()

options = [ tuple(course.values()) for course in courses]


return options

def college_options():
cursor = mysql.connection.cursor()
cursor.execute(''' SELECT college_code, name FROM college ''')
colleges = cursor.fetchall()
options = [tuple(college.values()) for college in colleges]

return options
Member 15021280 20-Mar-22 9:09am View    
Good evening, the problem is that my code so far runs in the terminal it is still not a GUI . I want to turn it into a GUI. Thank you
Member 15021280 10-Oct-21 5:20am View    
I have 1 error message and this comes from this part of the code
// The default constructor
DList()
{


curr = tail = head = new DLink<e>(NULL);
cnt=0;


} And tHE ERROR MESSAGE IS |97|error: no matching function for call to 'DLink<int>::DLink(NULL)'|
Member 15021280 9-Oct-21 2:51am View    
I am having trouble withe the
// The default constructor
DList()
{
//
// ??? - implement this method
//
}

// The class destructor
~DList()
{
//
// ??? - implement this method
//
}
based on what I have tried it send errors // The default constructor
DList()
{

DLink<e> *newLink = new Link <e>(NULL);
assert(newLink != NULL);
curr = tail = head = newLink;
cnt=0;


}

// The class destructor
~DList()
{

DLink<e> *linkPtr, *tempPtr;
linkPtr = head
while (linkPtr != NULL)
{
tempPtr = linkPtr;
linkPtr = linkPtr-> next();
delete tempPtr;
}

}