Jump to content

minus84

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Everything posted by minus84

  1. thnx i got that problem solved but the table styll wont loop to take the information out ot the database. i dont knw why im using the same sciprt on another loop and it works fine <? $sql_lowdown = mysql_query("SELECT id, mem_id, the_lowdown, post_time FROM lowdown_db WhHERE mem_id='$id' ORDER BY post_time DESC LIMI 20"); while($row = mysql_fetch_array($sql_lowdown)) { $lowid = $row["id"]; $uid = $row["mem_id"]; $the_lowdown = $row["the_lowdown"]; $the_date = $row["post_time"]; $the_date = strftime("%b %d, %Y", strtotime($post_time)); $LowdownDisplayList.= ' <table width="95%" align="center" cellpadding="4" bgcolor="#ffffff"> <tr> <td width="7%" height="161" bgcolor="#996600"><a href="profile.php?id=' .$id .'">' .$lowdown_pic . '</a><br/> </td> <td width="93%" bgcolor="#CCCCCC" ><a href="profile.php?id=' .$id .'">' .$firstname . ' ' .$lastname . ' </a> • <span style="font-size:10px;"> ' .$post_time . ' </span><br/> ' . $the_lowdown . ' </td> </table>'; } ?>
  2. i dont knw why its keep telling me Notice: Undefined variable: lowdownDisplay in C:\wamp\www\bullshit.php on line 112 some1 please tell me wot i can do to fix this $sql = mysql_query("SELECT id, mem_id, the_lowdown, post_time FROM lowdown_db ORDER BY post_time DESC LIMI 20"); //$lowdownDisplayList = ''; while ($row = mysql_fetch_array($sql)) { //$lowdownDisplay = '<table width="0%" border="0" align="center" cellpadding="5"> //<tr>'; $lowdownid = $row["id"]; $uid = $row["mem_id"]; $the_lowdown = $row["the_lowdown"]; $the_date = $row["post_time"]; $the_date = strftime("%b %d, %Y", strtotime($post_time)); ///// inner SQL QUERY $sql_mem_data = mysql_query("SELECT id, firstname, lastname FROM mymembers WHERE id='$uid' LIMIT 1"); $lowdownDisplayList.= '<td><div style="height:80px; overflow:hidden;" > ' .$user_pic. ' </div><a href="profile.php?id=' .$id. '"><br>'.$firstname.' '.$lastname.'</a></td> '; //$lowdownDisplayList = ''<td><div style="height:80px; overflow:hidden;" > ' .$user_pic. ' </div><a href="profile.php?id=' .$id. '"><br>'.$firstname.' '.$lastname.'</a></td> '; while ($row = mysql_fetch_array($sql_mem_data)){ $uid = $row["id"]; $ufirstname = $row["firstname"]; $ufirstname = $row["lastname"]; $ufirstname = substr($ufirstname,0,10); ///////display lowdown pic////////// $ucheck_pic = "memberFiles/$uid/image01.jpg"; $udefault_pic = "memberFiles/0/image01.jpg"; if (file_exists($ucheck_pic)) { $lowdown_pic = "<img src=\"$check_pic\" width=\"40px\" />"; // forces picture to be 100px wide and no more } else { $lowdown_pic = "<img src=\"$default_pic\" width=\"40px\" />"; // forces default picture to be 100px wide and no more } $lowdownDisplayList.= ' <table width="95%" align="center" cellpadding="4" bgcolor="#ffffff"> <tr> <td width="7%" height="161" bgcolor="#996600"><a href="profile.php?id=' .$id .'">' .$lowdown_pic . '</a><br/> </td> <td width="93%" bgcolor="#CCCCCC" ><a href="profile.php?id=' .$id .'">' .$ufirstname . ' ' .$ulastname . ' </a> • <span style="font-size:10px;"> ' .$post_time . ' </span><br/> ' .$the_lowdown. ' </td> </table>'; } } ?> [code/]
  3. im trying to enter data into a database with todays date(current date) ive tried the syntax now() but it does not work with my version WAMP 2.0 ive tried to search the manual but i cannot find it im runing MySQL 5.1 $sql = mysql_query("INSERT INTO lowdown_db (mem_id, the_lowdown, post_time) VALUES('$id','$lowdown_feild','now())") or die (mysql_error()); [code] can nebody tell me wot other sytax i can use thnxs
  4. keep gettin error msg Notice: Undefined index: id in C:\wamp\www\profile.php on line 42 dun everything to define the index cud it b the verion of wamp i am using if ($_GET['id']) { $id = $_GET['id']; } else if (isset($_SESSION['id'])) { $id = $_SESSION['id']; } else { print "important data to render this page is missing"; //include_once "index.php"; //} } //exit(); [code]
  5. hi im having trouble with my login script i keep getting the errors Deprecated: Function session_register() is deprecated in C:\wamp\www\login.php on line 53 Deprecated: Function session_register() is deprecated in C:\wamp\www\login.php on line 57 Deprecated: Function session_register() is deprecated in C:\wamp\www\login.php on line 61 i just wanted to knw wot they mean the page styll runs ok, is there any way i can make it work $sql = mysql_query("SELECT * FROM myMembers WHERE email='$email' AND password='$pass' AND email_activated='1'"); $login_check = mysql_num_rows($sql); if($login_check > 0){ while ($row = mysql_fetch_array($sql)){ $id = $row["id"]; session_register('id'); $_SESSION['id'] = $id; $firstname = $row["firstname"]; session_register('firstname'); $_SESSION['firstname'] = $firstname; $email = $row["email"]; session_register('email'); $_SESSION['email'] = $email; mysql_query("UPDATE myMembers SET last_log_date=now() WHERE id='$id'"); $my_msg="Hello $firstname, you have succesfully logged in"; //print "return_msg=$my_msg&id=$id&firstname=$firstname"; } // close while } else{ $my_msg="Error Your Password Or Email Did Not Match"; // print "return_msg=$my_msg"; exit(); } } also im having trouble with my my_msg variable it does not seem to show up i keep gettin error
  6. keep getting the error message Notice: Undefined index: pid in C:\wamp\www\phpcustom.php on line 6 not sure why <?php session_start(); include_once"scripts/connect_to_mysql.php"; //query for body and determing which page id to use in our query below if(!$_GET['pid']){ $pageid ='1'; } else { $pageid = $_GET['pid']; } //query for the section coverd in body $sql ="SELECT pagebody FROM pages WHERE id='$pageid' LIMIT 1"; $query = mysql_query($sql) or die (mysqli_error()); while($row= mysql_fetch_array($query)) { $body = $row["pagebody"]; } mysql_free_result($query);
  7. works beautofully, nice one
  8. i want it to render different rows of information from a mysql database in ascending order but its only bringing out the one, do you know another way to loop it
  9. <?php session_start(); include_once"scripts/connect_to_mysql.php"; //build main navigation menu and gather page data here $sql ="SELECT id, linklabel FROM pages ORDER BY pageorder ASC"; $query = mysql_query($sql) or die (mysqli_error()); $menuDisplay =""; while($row= mysql_fetch_array($query)) { $pid = $row["id"]; $linklabel = $row["linklabel"]; $menuDisplay ='<a href="phpcustom.php?pid=' . $pid . '">' . $linklabel . '</a><br/>'; } mysql_result($query); //mysqli_close($myConnection); ?> my while loop doesnt seem to b working any idea why, im also using dreamweaver 8 and mysqli function dont highlight or workin in my database where as mysql does is there any reason for this
  10. <html> <title>testing inserting php as code - do not reply</title> <body> <?php print "<h1>Congratulations, your server can process PHP!</h1>"; print "<h3>Here you can view the PHP configuration on your server</h3>"; phpinfo( ); exit(); ?> <html/> [code/]
  11. yeah ok thanksfor your help ive got it working now, im not sure y but i needed to change it to an include function but it did not work with require_once aswel as changing the db_name for future reference how do i enclose in php code like that is it <html > then close < html />
  12. <?php // Place db host name. Sometimes "localhost" but // sometimes looks like this: >> ???mysql??.someserver.net $db_host = "localhost"; // Place the username for the MySQL database here $db_username = "root"; // Place the password for the MySQL database here $db_pass = "XXXXXXXXXXXXX"; // Place the name for the MySQL database here //$db_name = "communityDB"; // Run the connection here @mysql_connect("$db_host","$db_username","$db_pass", "$db_name") or die ("could not connect to mysql"); @mysql_select_db("$communityDB") or die ("No Database"); ?> its styll being a pain,i have added the select_ db, what should i put in db name then?
  13. <?php $db_host = "localhost"; // Place the username for the MySQL database here $db_username = "root"; // Place the password for the MySQL database here $db_pass = "xxxxxxxxxxxx"; // Place the name for the MySQL database here $db_name = "communityDB"; @mysql_connect("$db_host","$db_username","$db_pass", "$db_name") or die ("could not connect to mysql"); ?> i double checked the code and added the last line u see there @mysql_connect, there are no longer any error messages, but the code will still will not create the tables in MySQL
  14. it connects the database fine so i dont know y there would be an error <?php include_once"connect_to_mysql.php"; //Tell myself on screen that we have connected succesfully print"success in database CONNECTION....<br/>"; //creates the members main table in your new database $result = "CREATE TABLE myMemberstest( id int(11)NOT NULL auto_increment, firstname varchar(255)NOT NULL, middlename varchar(255)NULL, lastname varchar(255)NOT NULL, country varchar(255)NOT NULL, city varchar(255)NOT NULL, county varchar(255)NOT NULL, postcode varchar(255)NOT NULL, phone varchar(255)NOT NULL, email varchar(255)NOT NULL, password varchar(255)NOT NULL, sign_up_date date NOT NULL default '0000-00-00', last_log_date NOT NULL default '0000-00-00', bio_body text NULL, website varchar(255) NULL, youtube varchar(255) NULL, account_type enum('a','b','c') NOT NULL default 'a', email_activated enum('0','1') NOT NULL default '0', PRIMARY KEY(id), UNIQUE KEY email(email) )"; if(mysql_query($result)){ print"success in TABLE creation!.... <br/><br/><b>That compleates the table setup, now delete the file <br/> named'create_Table.php'and you are ready to move on Let us go</b>"; } else { print"no TABLE created, You have problems in the system already back track and try again"; } exit(); ?>
  15. Hi guys im fairly new to php and im following a tutorial on youtube about how to set up a comminuity website, im using WAMP. i am trying to create a php page that creates a table in MySQL but i keep gettin the the error messages Warning: mysql_query() [function.mysql-query]: Access denied for user 'SYSTEM'@'localhost' (using password: NO) in C:\wamp\www\scripts\create_Table.php on line 34 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\scripts\create_Table.php on line 34 i have set up a password on my localhost so i have no idea why this is happening can someone please explain to me what settings i need to change thnx
×
×
  • 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.