KeemW Posted September 6, 2014 Share Posted September 6, 2014 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? Quote Link to comment https://forums.phpfreaks.com/topic/290889-php-files-from-mac-os-and-windows-problem/ Share on other sites More sharing options...
mac_gyver Posted September 6, 2014 Share Posted September 6, 2014 we can only help you if we know what errors you are getting and what the corresponding code is. Quote Link to comment https://forums.phpfreaks.com/topic/290889-php-files-from-mac-os-and-windows-problem/#findComment-1490147 Share on other sites More sharing options...
KeemW Posted September 6, 2014 Author Share Posted September 6, 2014 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 258Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\Sportify\index.php on line 258Warning: 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 } ?> Quote Link to comment https://forums.phpfreaks.com/topic/290889-php-files-from-mac-os-and-windows-problem/#findComment-1490164 Share on other sites More sharing options...
Solution Ch0cu3r Posted September 6, 2014 Solution Share Posted September 6, 2014 Before using msyql_query you need to have opened a connection to mysql. This is most likely why you are getting that error message. See mysql_connect documention for connecting to mysql. NOTE use of mysql_* functions are deprecated meaning they are no longer supported and could be removed from future version of PHP. I strongly recommend you start converting your code over to PDO or MySQLi Quote Link to comment https://forums.phpfreaks.com/topic/290889-php-files-from-mac-os-and-windows-problem/#findComment-1490170 Share on other sites More sharing options...
mac_gyver Posted September 6, 2014 Share Posted September 6, 2014 this is the same error you had in your first thread on this forum. are you learning from your experience so that you don't repeat the same problems? you also used the mysqli database functions in your second thread on this forum. why now go backwards using the msyql functions? Quote Link to comment https://forums.phpfreaks.com/topic/290889-php-files-from-mac-os-and-windows-problem/#findComment-1490180 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.