Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Warning: mysql_query() [function.mysql-query]:

Featured Replies

I’m building a social network website and I was doing so well until now. ALL my connections are good. I’ve got my script in the proper file / location.

 

This is my error response…

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'mywebsite'@'localhost' (using password: NO) in /home/mywebsite/public_html/root/scripts/homePage_randomMembers.php on line 6

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/mywebsite/public_html/root/scripts/homePage_randomMembers.php on line 6

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mywebsite/public_html/root/scripts/homePage_randomMembers.php on line 7

 

This is my script…

 

<?php

$MemberDisplayList = '<table border="0" align="center" cellpadding="6">

<tr> ';

// Mysql connection is already made in the file this one gets included into

// So we can run queries here without having to connect again

$sql = mysql_query("SELECT id, username, firstname FROM myMembers WHERE email_activated='1' ORDER BY RAND() LIMIT 6");

while($row = mysql_fetch_array($sql)){

$id = $row["id"];

$username = $row["username"];

$firstname = $row["firstname"];

if (!$firstname) {

$firstname = $username;

}

$firstnameCut = substr($firstname, 0, 10);

$check_pic = "members/$id/image01.jpg";

if (file_exists($check_pic)) {

$user_pic = "<img src=\"members/$id/image01.jpg\" width=\"64px\" border=\"0\" />";

} else {

$user_pic = "<img src=\"members/0/image01.jpg\" width=\"64px\" border=\"0\" />";

}

$MemberDisplayList .= '<td><a href="res.php?id=' . $id . '" title="' . $firstname . '"><font size="-2">' . $firstnameCut . '</font></a><br />

<div style=" height:64px; overflow:hidden;"><a href="res.php?id=' . $id . '" title="' . $firstname . '">' . $user_pic . '</a></div></td>';

 

} // close while loop

 

$MemberDisplayList .= ' </tr>

</table> ';

?>

 

Please Help!

Thanks in advance,

Scotty13

As the error says, you've not got permission to access the table with the credentials given. Does your user have a password? if so, it's not been set

I presume you have missed off the include('../path/to/database/file.php'); since there is no connection set to the database.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.