|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with Pear DB Query & Fetch
First - I apologize for the cross post (also posted in PHP forum) but I am not sure in which forum this post belongs.
I am not a programmer, but I know enough to figure out how to manipulate pre-existing lines of code, usually. However, the programmer that I was working with recently went AWOL and I at a loss for a solution to a recent site issue I am experiencing. The code below is taken from a page used to create a module which allows my site users to post reviews about individual lenders (in a database). However, each of my site users (also a database) can only post 1 review about each lender. I need to make it possible for site users to post multiple reviews and comments. FYI - the rating system is a 5-star system with a cumulative effect. I can supply more code if necessary, but I am really at a loss here. Any help with making this possible would be GREATLY appreciated. Thank you in advance... Alanna ---------------------------------------------------- Here is the code snippet: if ( !defined( 'PEAR_DIR' ) ) { include_once ( "./init.php" ); } require ( 'password_protect.php' ); $sql='SELECT revnum FROM reviews WHERE lendnum='.$_POST[lendnum].' AND adminnum='.$admin[userid]; if ($db->getOne($sql) != '') { echo 'You have already rated this lender.'; exit(); } $sql="INSERT INTO reviews (lendnum, adminnum, rating, review, author, authphone1, authphone2) VALUES ('$_POST[lendnum]', '$admin[userid]', '$_POST[R1]', '$_POST[S1]', '$admin[fname] $admin[lname]', '$admin[phone1]', '$admin[phone2]')"; $db->query($sql); $prevlender=$_POST[lendnum]; header("Location:lenderdetails.php?lender=$prevlender"); ?> |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > Help with Pear DB Query & Fetch |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|