Jump to content

ivanella

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ivanella's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $link_field6 is a field of database that conteins values like: "Marco" or "Luca" or "Anna" while $attori is a variabile with values like: "Marco Luca Anna" ....thanks for help....
  2. I guys, i'm sorry for my english but i'm italian girl. I need help for this script: $sql = "SELECT link_title FROM film_links WHERE '{$attori}' LIKE CONCAT( '%', link_field6, '%' )"; it dosnt work, do you know why??? thanks for help....
  3. I tried in this way: echo ' <table border="1"> '; while ($row = mysql_fetch_assoc($res)) { $userID = htmlentities($row['userID']); $Name = htmlentities($row['Name']); $numero_commenti = htmlentities($row['numero_commenti']); echo "<tr> <td>$userID</td> <td>$Name</td> <td>$numero_commenti</td> </tr>"; } echo '</table>';
  4. I correct the code: and now the script work.... $sql = "SELECT u.UserID,Name,AuthUserID,c.CommentID,count(*) AS numero_commenti FROM consigli_User AS u JOIN consigli_Comment AS c JOIN consigli_ThankfulPeople AS v ON u.UserID=c.AuthUserID AND c.AuthUserID=v.UserID AND c.CommentID=v.CommentID GROUP BY numero_commenti ORDER BY numero_commenti DESC"; $res=mysql_query($sql) or die ("Query non valida: $sql <br>Errore: ".mysql_error()); but now, how can i show the list of all User showing: UserID, Name, numero_commenti thanks for help....
  5. this is the woole code.... I tried with this code: ho modificato il codice in: $sql = "SELECT UserID,Name,AuthUserID,CommentID,count(*) AS numero_commenti FROM consigli_User AS u JOIN consigli_Comment AS c JOIN consigli_ThankfulPeople AS v ON u.UserID=c.AuthUserID AND c.AuthUserID=v.UserID AND c.CommentID=v.CommentID GROUP BY numero_commenti ORDER BY numero_commenti DESC"; $res=mysql_query($sql) or die ("Query non valida: $sql <br>Errore: ".mysql_error()); while ($row = mysql_fetch_row($res)) { echo 'ID: ', $row[0] , ' Nome: ', $row[1] , "\n"; } and i have this error: Query non valida: SELECT UserID,Name,AuthUserID,CommentID,count(*) AS numero_commenti FROM consigli_User AS u JOIN consigli_Comment AS c JOIN consigli_ThankfulPeople AS v ON u.UserID=c.AuthUserID AND c.AuthUserID=v.UserID AND c.CommentID=v.CommentID GROUP BY numero_commenti ORDER BY numero_commenti DESC Errore: Column 'UserID' in field list is ambiguous help?????
  6. sorry i made a mistake... TABLE 3 nome tabella: "consigli_ThankfulPeople"
  7. Hi guys i have a problem: in my DATABASE i have 3 tables TABLE 1 name : "consigli_User" fields : "UserID" and "Name" TABLE 2 name : "consigli_Discussion " fields : "AuthUserID" and "CommentID" TABLE 3 name : "consigli_Discussion " fields : "UserID" and "CommentID" i execute the script: $sql = "SELECT UserID,Name,AuthUserID,CommentID,count(*) AS numero_commenti FROM consigli_User AS u JOIN consigli_Comment AS c JOIN consigli_ThankfulPeople AS v ON u.UserID=c.AuthUserID AND c.AuthUserID=v.UserID AND c.CommentID=v.CommentID GROUP BY numero_commenti ORDER BY numero_commenti DESC"; $res=mysql_query($sql) or die ("Query non valida: $sql"); while ($row = mysql_fetch_row($res)) { echo 'ID: ', $row[0] , ' Nome: ', $row[1] , "\n"; } I need to list the user with the numbers of "thanks" recived to their coments by there is an error: Query error: SELECT UserID,Name,AuthUserID,CommentID,count(*) AS numero_commenti FROM consigli_User AS u JOIN consigli_Comment AS c JOIN consigli_ThankfulPeople AS v ON u.UserID=c.AuthUserID AND c.AuthUserID=v.UserID AND c.CommentID=v.CommentID GROUP BY numero_commenti ORDER BY numero_commenti DESC please help me...
  8. I tried this Query: $sql = "SELECT UserID ,Name,count(*) AS numero_commenti FROM consigli_User AS u JOIN consigli_Comment AS c JOIN consigli_ThankfulPeople AS v ON u.UserID=c.UserID AND c.UserID=v.UserID AND c.CommentID=v.CommentID GROUP BY Name ORDER BY numero_commenti DESC "; while ($row = mysql_fetch_row($sql)) { echo 'ID: ', $row[0] , ' Nome: ', $row[1] , "\n"; } but I recive this error: mysql_fetch_row(): supplied argument is not a valid MySQL result can you help me? thanks....
  9. first of all thanks for help.... I didn't explain well what i need..... because is so comlex for me.... In DATABASE i have: table "USER" with ures information like "ID" and "NOME" table "VOTI" with field like "COMMENTOID" and "USERID" that say wich user has voted for the comment. table "COMMENTI" with field "COMMENTOID" e "USERID" that say wich user has insert the comment. The Script has to take "ID" and "NOME" for each member from table "USER", see from table "COMMENTI" what are the comments the user has insert and find from table "VOTI" how many times a comment insert from him has been voted. Then create a list of user whit the number of votes he recived to his comments.... It's so difficoult ...help me please....
  10. Hi i'm italian so i don't speak english well... I must do a script... but i'm not expert... The php script has to crate a list of my site members showing the fields "ID" and "NAME" of "USER" table in DATABASE. It's difficult becausa the script has to show for each user the number of votes. The number of votes has to be calculated for each user counting the number of ROWS in table "VOTI" that contain in the field "UserID" the "ID" of user. I know, it's difficult, but i hope there is someone that can help me.... Thanks...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.