Nairb
Members-
Posts
18 -
Joined
-
Last visited
Never
Contact Methods
-
AIM
BrianStrCrft
-
MSN
lysol__@hotmail.com
-
Yahoo
nairbynairb
Profile Information
-
Gender
Not Telling
-
Location
Canada
Nairb's Achievements
Newbie (1/5)
0
Reputation
-
Just curious... Shouldn\'t it be: [php:1:fe23b0cc40] SELECT * FROM clients WHERE business = \'self\' AND area = \'south ayrshire\'\" [/php:1:fe23b0cc40]
-
That doesnt work because you have to actually perform the query first
-
I\'m making a CMS which works from MySQL. right now I\'m just starting off with some simple commands to call the template from the database but it gives me this error (even though everything shows up correctly): Parse error: parse error, unexpected T_LNUMBER in /home/eefactor/public_html/nairb/index.php(38) : eval()\'d code on line 1 line 38 is: [php:1:3b12f0a7dc] $sql2 = \"SELECT `name` , `template` FROM `templates` WHERE `name` = \'header\'\"; $query2 = mysql_query($sql2) or die (mysql_error()); while($row2 = mysql_fetch_array($query2)) { $header = $row2[\"template\"]; $header = stripslashes($header); eval (\"$header = \"$header\";\"); // ##### line 38 ##### }[/php:1:3b12f0a7dc] Thanks for any help
-
Lol, hmmm... Once again, try assigning some stuff: [php:1:4eac3f3181] if ($roster_trackchanges == 1) { $session = $_SESSION[mem_alias]; $date = date(); $time = time(); $query_changes = \"INSERT INTO roster_changes(er, ee, type, date, time) VALUES(\'user\',\'$session\',\'edited\',\'$date,\' \'$time\')\"; mysql_query($query_changes); } [/php:1:4eac3f3181] Again, just a suggestion?
-
Try assigning the session, so you dont have to break it, or w/e [php:1:8452372283] if ($roster_trackchanges == 1) { $session = $_SESSION[mem_alias]; $query_changes = \"INSERT INTO roster_changes(er, ee, type, date, time) VALUES(\'user\',\'$session\',\'edited\',date(), time())\"; mysql_query($query_changes); } [/php:1:8452372283] Try that, it\'s all I can think of
-
Ohh ya, I forgot to mention I\'m trying to make it have alternating colors... that\'s what this part is for: for($i = 0; $i < $numofrows; $i++) { if($i % 2) { $color = "#BBBBBB"; } else { $color = "#EEEEEE"; }
-
umm, ok I\'m trying to display my news results, but it\'s showing 5 of each here\'s the code: <? include("./admin/config.php"); $conn=mysql_connect ("$servername", "$dbusername", "$dbpassword") or die (\'I cannot connect to the database because: \' . mysql_error()); mysql_select_db ("$dbname"); $sql = "SELECT * FROM news ORDER BY newsid ASC LIMIT 0,30"; $getnews = mysql_query($sql); $numofrows = mysql_num_rows($getnews); while($row = mysql_fetch_array($getnews)) { echo "<table width=90%>"; for($i = 0; $i < $numofrows; $i++) { if($i % 2) { $color = "#BBBBBB"; } else { $color = "#EEEEEE"; } $username = $row["newsauthor"]; $avatar = $row["useravatar"]; $email = $row["useremail"]; $subject = $row["newsubject"]; $newstext = $row["newstext"]; echo "<tr><td><br><table width=90% cellspacing=0 cellpadding=1 bgcolor=000000><tr><td> <TABLE bgcolor=$color width=100%><tr> <td>Username: <b>$username <img src="$avatar"></b></td> </tr> <tr> <td>Email: <b>$email</b></td> </tr> <tr> <td>Subject: <b>$subject</b></td> </tr> <tr> <td>News: <b>$newstext</b></td> </tr> </table></td> </tr> </table></td></tr>"; } echo "</table>"; } ?> Any help is welcome, thanks
-
Ok, I know that in the Membership Tutorial they have sessions... But I don\'t understand how they work... I\'m writing a news script... I need it so that when a user logs in, they\'re logged in until they log out... Could someone PLEASE explain this?
-
Lol, sorry again... Ok, now I\'m trying to make it so that the users cant use a name already in use... here\'s what I have: $checkusr = mysql_query("SELECT FROM `user` WHERE username=`$HTTP_POST_VARS[\'username\']); $checkusrres = mysql_result($checkusr); if (isset($checkusrres) { echo "The username $HTTP_POST_VARS[\'username\'] is already taken."; exit; //terminate exec. } else { echo "Registration sucessful, $HTTP_POST_VARS[\'username\']!"; } Damn programming.. the logic is easy, the scripting is hard :\'( Any help is welcome, please
-
I got that working What I\'m trying to do now, is set up a user database... I have the tables and everything. I\'m trying to make a userlist.php that displays all the users I have: <?php $conn=mysql_connect ("localhost", "nairb", "mypw") or die (\'I cannot connect to the database because: \' . mysql_error()); mysql_select_db ("nairb",$conn); $sql="SELECT * FROM users"; $result=mysql_query($sql,$conn); if ($result) { while($row = mysql_fetch_array($result)) { echo " <table border=\'0\'><tr> <td>Username: <b>".$row["username"]."</b></td> </tr> <tr> <td>Email: <b>".$row["email"]."</b></td> </tr> <tr> <td>Age: <b>".$row["age"]."</b></td> </tr> <tr> <td>Gender: <b>$gender</b></td> </tr></table><br>"; } } mysql_close($conn); ?> How do I get it to show the gender? I have it so when you register, it inputs 1 into the database for male, and a 2 for female... Thanks EDIT: I figured it out, thanks anyways
-
ok, now for submitting news into the database? for submitnews.php: <? $conn=mysql_connect ("localhost", "nairb", "mypw") or die (\'I cannot connect to the database because: \' . mysql_error()); mysql_select_db ("nairb",$conn); $sql = "SELECT * FROM news"; $result=mysql_query($sql,$conn); ?> <BODY BGCOLOR=#8FB2D1 LEFTMARGIN=0 TOPMARGIN=5 MARGINWIDTH=0 MARGINHEIGHT=0> <TABLE WIDTH=600 BORDER=0 CELLPADDING=4 CELLSPACING=1 align="center" bgcolor="#000000"> <TR> <TD bgcolor="#B9CFE2"> <TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0 align="center" bgcolor="#000000" width="100%"> <TR align="top"> <TD bgcolor="#B9CFE2" align="top"> <font color="#5880A4" size=2 face="arial"> <form action="addnews.php"> <input type="hidden" name="article" value="<?php $result[article]; ?>"> Username: </td><TD bgcolor="#B9CFE2" align="top"><input type="text" name="user"><br> </td></tr> <TR align="top"> <TD bgcolor="#B9CFE2" align="top"> <font color="#5880A4" size=2 face="arial"> News Id: </td><TD bgcolor="#B9CFE2" align="top"><?php echo "<b>".$result["article"]."</b>"; ?><br> </td></tr> <TR align="top"> <TD bgcolor="#B9CFE2" align="top"> <font color="#5880A4" size=2 face="arial"> News Text: </td><TD bgcolor="#B9CFE2" align="top"><textarea cols="40" rows="5" name="text">Insert the news here.</textarea><br> <input type="submit" value="submit"> </form> and for addnews.php: <BODY BGCOLOR=#8FB2D1 LEFTMARGIN=0 TOPMARGIN=5 MARGINWIDTH=0 MARGINHEIGHT=0> <TABLE WIDTH=600 BORDER=0 CELLPADDING=4 CELLSPACING=1 align="center" bgcolor="#000000"> <TR> <TD bgcolor="#B9CFE2"> <font color="#5880A4" size=2 face="arial"> <?php $conn=mysql_connect ("localhost", "nairb", "mypw") or die (\'I cannot connect to the database because: \' . mysql_error()); mysql_select_db ("nairb",$conn); $result = mysql_query("INSERT INTO `news` (`user`, `article`, `text`) VALUES (\'$user\', \'$article\', \'$text\');",$conn); mysql_close($conn); ?> it works good(adding the news), but i want the article id to increase everytime...?
-
I get the error: Parse error: parse error, unexpected T_WHILE in /usr/local/psa/home/vhosts/gameplay4u.com/httpdocs/nairb/gp4u/admin/userlist.php on line 8