martin9t9
Members-
Posts
19 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
martin9t9's Achievements
Newbie (1/5)
0
Reputation
-
are you there gristoi?
-
ok didnt work its showing up ALOT of Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 68 it just keeps loading more and more and isnt showing any of my posts anymore
-
ok it worked on the first post that shows up but everyone after that it says: Warning: mysql_query() [function.mysql-query]: Can't connect to MySQL server on 'localhost' (10061) in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 66 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 66 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 68 Warning: mysql_close(): no MySQL-Link resource supplied in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 73 and right at the bottom it says: Warning: mysql_close(): no MySQL-Link resource supplied in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 89
-
just to let you know it says it cant connect to the server on 'localhost' mines not local host its an IP address not sure if this helps. <?php require_once('auth.php'); ?> <?php $id = $_SESSION['SESS_MEMBER_ID'] ?> <html> <head> <title>Announcement</title> </head> <body> <table border="0" width="100%" height="100%"> <tr height="15%"> <td colspan="5"><?php include "header.php"; ?></td> </tr> <tr> <td> <table border="0" width="100%" height="100%"> <tr> <td width="25%" valign="top"><div valign="top"><?php include "menu.php"; ?></div></td> <td width="50%" valign="top"><center> <center><div class="subheading"><b>All Networks</b></div></center> <?php $host="1*2.*0.1*3.2*"; // Host name $username="martin9t9"; // Mysql username $password="***"; // Mysql password $db_name="martin9t9"; // Database name $tbl_name="post"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect server "); $sql="SELECT * FROM martin9t9.$tbl_name ORDER BY id DESC"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ ?> <table border="0" width="100%"> <tr> <td rowspan="2" width="45" height="45"> </td> <td colspan="2"><a href="view-profile.php?uid=<?php echo $rows['uid'] ?>" class="postname"><? echo $rows['first']; ?> <? echo $rows['last']; ?></a> on <a class="postname"><? echo $rows['network']; ?></a></td> </tr> <?php $network = $rows['network']; $postid = $rows['id']; ?> <tr> <td><div class="post"><? echo $rows['post']; ?></div></td> <td width="45"></td> </tr> <tr> <td colspan="3" class="text" align="right"> <?php if($rows['user'] !== $_SESSION['SESS_USER']) { echo '<a href="like-exec.php?postid=' . $rows['id'] . '&url=member-index.php"><img src="resources/tick.png" alt="Like" border="0"></img></a><font class="like"> ' . $sql2="SELECT SUM(yes) as total FROM martin9t9.rating WHERE postid='$postid'"; $result2=mysql_query($sql2); while($rows=mysql_fetch_array($result2)){ echo $rows['total']; } mysql_close(); //close database echo '</font> - <a href="dislike-exec.php?postid=' . $rows['id'] . '&url=member-index.php&like=' . $rows['no'] . '"><img src="resources/cross.png" alt="Dislike" border="0"></img></a> <font class="dislike"> ' . $rows['no'] . '</font>'; } else { echo '<font class="like"> ' . $rows['yes'] . '</font> - <font class="dislike"> ' . $rows['no'] . '</font>'; ?> </td> </tr> </table> <hr color="#F0F0F0"> <? }} mysql_close(); //close database ?> </center></td> <td width="25%"></td> </tr> </table> </td> </tr> </table> </body> </html>
-
the same things happening... its also echoing ' SELECT SUM(yes) as total FROM martin9t9.rating WHERE postid='125' '
-
sorry but it still didnt work... it showed my webpage but it had a heap of errors in it : SELECT SUM(yes) as total FROM martin9t9.rating WHERE postid='105' Warning: mysql_query() [function.mysql-query]: Can't connect to MySQL server on 'localhost' (10061) in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 67 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 67 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 69 Warning: mysql_close(): no MySQL-Link resource supplied in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 90 Warning: mysql_close(): no MySQL-Link resource supplied in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 74
-
im getting the error Parse error: syntax error, unexpected T_ELSE in D:\Hosting\7833904\html\announcement\admin\member-index.php on line 72
-
where could i put this code?
-
hey guys this is sorta hard to explain so ill give it a go anyways, just bare with me. on my site im retrieving data from a database and what i wanna do is retrieve data from another database but have it in the other database here's the code of what ive got: <?php require_once('auth.php'); ?> <?php $id = $_SESSION['SESS_MEMBER_ID'] ?> <html> <head> <title>Announcement</title> </head> <body> <table border="0" width="100%" height="100%"> <tr height="15%"> <td colspan="5"><?php include "header.php"; ?></td> </tr> <tr> <td> <table border="0" width="100%" height="100%"> <tr> <td width="25%" valign="top"><div valign="top"><?php include "menu.php"; ?></div></td> <td width="50%" valign="top"><center> <center><div class="subheading"><b>All Networks</b></div></center> <?php $host="***"; // Host name $username="***"; // Mysql username $password="***"; // Mysql password $db_name="***"; // Database name $tbl_name="post"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name ORDER BY id DESC"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ ?> <table border="0" width="100%"> <tr> <td rowspan="2" width="45" height="45"> </td> <td colspan="2"><a href="view-profile.php?uid=<?php echo $rows['uid'] ?>" class="postname"><? echo $rows['first']; ?> <? echo $rows['last']; ?></a> on <a class="postname"><? echo $rows['network']; ?></a></td> </tr> <?php $network = $rows['network']; $postid = $rows['id']; ?> <tr> <td><div class="post"><? echo $rows['post']; ?></div></td> <td width="45"></td> </tr> <tr> <td colspan="3" class="text" align="right"> <?php if($rows['user'] !== $_SESSION['SESS_USER']) echo '<a href="like-exec.php?postid=' . $rows['id'] . '&url=member-index.php"><img src="resources/tick.png" alt="Like" border="0"></img></a><font class="like"> ' . $host1="***"; // Host name $username1="***"; // Mysql username $password1="***"; // Mysql password $db_name1="***"; // Database name $tbl_name1="rating"; // Table name // Connect to server and select database. mysql_connect("$host1", "$username1", "$password1")or die("cannot connect server "); mysql_select_db("$db_name1")or die("cannot select DB"); $sql="SELECT SUM(yes) as total FROM $tbl_name1 WHERE postid='$postid'"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ echo $rows['total']; } mysql_close(); //close database '</font> - <a href="dislike-exec.php?postid=' . $rows['id'] . '&url=member-index.php&like=' . $rows['no'] . '"><img src="resources/cross.png" alt="Dislike" border="0"></img></a> <font class="dislike"> ' . $rows['no'] . '</font>'; else echo '<font class="like"> ' . $rows['yes'] . '</font> - <font class="dislike"> ' . $rows['no'] . '</font>'; ?> </td> </tr> </table> <hr color="#F0F0F0"> <? } mysql_close(); //close database ?> </center></td> <td width="25%"></td> </tr> </table> </td> </tr> </table> </body> </html> please help with is bugging me so much!
-
Could you please give me an example of how to do this, I am pretty new to php.
-
I can't use that because I want more than one session depending on the variable. What I'm doing is making a website where you can make posts then you can rate them but I only want them to beable to be rated once by that person so I was gonna make a session to make that so.
-
Pretty much all I wanna do is use this code $_SESSION['$variable'] = 'something'; but what's the syntax? I can't seem to beable to use $variable where it is like that.
-
hey guys im writing some code for my website... it goes like this Page 1 <?php /* this page is sent to page 2 */ $postid = 105; ?> Page 2 <?php session_start(); /* this page redirects to page 3 */ $_SESSION[$postid]='rating'; ?> Page 3 <?php if($_SESSION['$rows['id'] == $rows['id']) echo 'yes'; else echo 'no'; ?> this code is on www.martin9t9.com/announcement once youve signed up join the pakenham network then go to the homepage and click on of the ticks, i wanna make it so you can only press that button once. the part im unsure of is the $_SESSION[$postid] = 'true'; part i dont understand why i can use the variable there.
-
this is the code i tried with the code you gave me <?php require_once('auth.php'); ?> <?php $id = $_SESSION['SESS_MEMBER_ID'] ?> <html> <head> <title>Profile - Announcement</title> </head> <body> <table border="0" width="100%" height="100%"> <tr height="15%"> <td colspan="5"><?php include "header.php"; ?></td> </tr> <tr> <td> <table border="0" width="100%" height="100%"> <tr> <td width="25%" valign="top"><div valign="top"><?php include "menu.php"; ?></div></td> <td width="50%" valign="top"><center> <table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="black"> <tr> <td> <h2><center><b>Your Profile</b></center></h2> <?php include 'profile-menu.php'; ?><br /> <div class="subheading"><center><b>Join A Network</b></center></div> <p> <?php $host="***"; // Host name $username="martin9t9"; // Mysql username $password="***"; // Mysql password $db_name="martin9t9"; // Database name $tbl_name="networks"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name ORDER BY id DESC"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ $link = (in_array($network,$n_membership)) ? "produce un-join link here..." : "produce join link here..." ; ?> <?php $network = $rows['network']; ?> <table border="0" width="100%"> <tr><div class="text"> <td class="postname"><? echo $rows['network']; ?><td> <td width="20%"> <?php echo $link; ?> </td> </div></tr> </table> <hr color="#F0F0F0 "> <? } mysql_close(); //close database ?> <p/> </td> </tr> </table> </center></td> <td width="25%"></td> </tr> </table> </td> </tr> </table> </body> </html> <?php $host="***"; // Host name $username="martin9t9"; // Mysql username $password="***"; // Mysql password $db_name="martin9t9"; // Database name $tbl_name="usernetworks"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name WHERE uid='$id' ORDER BY id DESC"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ ?> <?php $n_membership = $rows['network']; ?> <? } mysql_close(); //close database ?>