Jump to content

KeemW

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by KeemW

  1. This is from index.php Error: Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\Sportify\index.php on line 258 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\Sportify\index.php on line 258 Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Sportify\index.php on line 259 echo "<div class='content-bottom'> <div class='box1' >"; $result = mysql_query("SELECT * FROM product WHERE status = 'OPEN' ORDER BY id DESC"); if(!$row = mysql_fetch_assoc($result)) { echo "Sorry no item added!"; } else { $counter = 0; $max = 3; $result = mysql_query("SELECT * FROM product WHERE status = 'OPEN' ORDER BY id DESC"); while ($row = mysql_fetch_assoc($result) and ($counter < $max)) { $id = $row['id']; $prod_name = $row['prod_name']; $prod_price = $row['prod_price']; $prod_details = $row['prod_details']; $prod_imgname = $row['prod_imgname']; echo "<div class='col_1_of_3 span_1_of_3' style ='margin:14px;' ><a href='index.php?page=prod_details.php&id=$id'> <div class='view view-fifth' > <div class='top_box'> <h3 class='m_1'>$prod_name</h3> <div class='grid_img'> <div class='css3'><img src='image/$prod_imgname' width ='300px' height = '300px'/></div> <div class='mask'> <div class='info'>Quick View</div> </div> </div> <div class='price'>RM $prod_price</div> </div> </div> <span class='rating'> <input type='radio' class='rating-input' id='rating-input-1-5' name='rating-input-1'> <label for='rating-input-1-5' class='rating-star1'></label> <input type='radio' class='rating-input' id='rating-input-1-4' name='rating-input-1'> <label for='rating-input-1-4' class='rating-star1'></label> <input type='radio' class='rating-input' id='rating-input-1-3' name='rating-input-1'> <label for='rating-input-1-3' class='rating-star1'></label> <input type='radio' class='rating-input' id='rating-input-1-2' name='rating-input-1'> <label for='rating-input-1-2' class='rating-star'></label> <input type='radio' class='rating-input' id='rating-input-1-1' name='rating-input-1'> <label for='rating-input-1-1' class='rating-star'></label> (45) </span> <ul class='list'> <li> <img src='images/plus.png' alt=''/> <ul class='icon1 sub-icon1 profile_img'> <li><a class='active-icon c1' href='#'>Add To Bag </a> <ul class='sub-icon1 list'> <li><h3>sed diam nonummy</h3><a href=''></a></li> <li><p>Lorem ipsum dolor sit amet, consectetuer <a href=''>adipiscing elit, sed diam</a></p></li> </ul> </li> </ul> </li> </ul> </a></div> "; $counter++; } } echo "<div class='clear'></div> </div> </div> </div> </div> "; //stop } else { include($page); //include('home.php'); //ECHO "hiiii."; ?> <?php } ?>
  2. Hai, i have a project which is build from mac os and then i transfer all the file to windows and run it. Alot of error showing on windows but none on mac os. I already check the short tag but still alot of problem to run from windows. Anyone know whats the problem?
  3. i think i solved my problem. i didnt know that only mac can read the php's lazy short open tag thank you!
  4. when i run on windows, alot of file have this error: Parse error: syntax error, unexpected $end in But on mac nothing problem. php version running on mac is 5.3.1 same as version on windows.
  5. Just wanna know if my website file take from macOS and run it in Windows why all the file have alot of error?
  6. Im using old xampp. Should i update it? but im using php4
  7. Hai, i'm not sure how to fix this error. any other method to update database? Error: PHP: <?php $con=mysqli_connect("localhost","root","","sportify"); //check connection if (mysqli_connect_errno()) { echo "failed"; } /* mysql_select_db(stationary, $con) or die("Could not select database"); */ /* include ('connection.php'); */ //$id = $_GET['id']; $sql="UPDATE admin SET name='$_POST[name]', email='$_POST[email]', phone='$_POST[phone]', address='$_POST[address]' WHERE id = '$_POST[id]'"; if (mysqli_query($con,$sql)) { header("Location: main_admin.php?page=admin_edit_profile.php&id='$_POST[id]'"); //?id=".$_POST['id']." } mysqli_close($con); ?>
  8. I have another problem that i can't solve. Error: Php: <?php $id = $_GET['id']; $result1 = mysql_query("SELECT * FROM admin WHERE username = '$_SESSION[username]' ORDER BY id"); while ($row1 = mysql_fetch_assoc($result1)) { $name = mysql_result($result1, 0, 'name'); $phone = mysql_result($result1, 0, 'phone'); $email = mysql_result($result1, 0, 'email'); $address = mysql_result($result1, 0, 'address'); } echo "Welcome to Admins Dashboard"; echo "<div style = 'border:0px solid #000;padding:20px;border-radius:15px;'><table width = '30%'> <tr><td colspan =3 style = 'text-align:right;'><a href = 'main_admin.php?page=admin_edit_profile.php&id=$id'><img src = '../images/edit.png' title = 'edit profile' style = 'width:25px;height:25px;'></a> <a href = 'main_admin.php?page=admin_edit_password.php&id=$id'><img src = '../images/changepassword.png' title = 'change password' style = 'width:25px;height:25px;'></a> </td></tr> <tr><td>Name</td><td> : </td><td>$name</td></tr></p>"; echo "<tr><td>Contact</td><td> : </td><td>$phone</td></tr>"; echo "<tr><td>E-Mail Address</td><td> :</td><td> $email</td></tr>"; echo "<tr><td>Address</td><td> :</td><td> $address</td></tr></table></div>"; ?>
  9. Thank you cyberRobot! Problem fixed.
  10. Hi, below is the error and php that i used for my login page. Error: Php: <?php //session_start(); $today = date(Ymd); $_SESSION[username] = $_POST['username']; $_SESSION[password] = $_POST['password']; $_SESSION[id] = $_POST['id']; $username = stripslashes($_SESSION[username]); $password = stripslashes($_SESSION[password]); $username = mysql_real_escape_string($_SESSION[username]); $password = mysql_real_escape_string($_SESSION[password]); $id = mysql_real_escape_string($_SESSION[id]); include('connection.php'); $sql_login = "SELECT id FROM admin WHERE username = '$username' and password = '$password'"; $result_login = mysql_query($sql_login); $count_login = mysql_num_rows($result_login); //$row = mysql_fetch_assoc($sql_login); if($count_login == 1) { //session_register("user_email"); //session_register("user_password"); //echo "PASS"; header("location:../admin/main_admin.php"); } else { header("location:admin_login2.php"); } exit; ?> Please guide me.
×
×
  • 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.