windows7 messages

Problems with the Windows version of XAMPP, questions, comments, and anything related.

windows7 messages

Postby ckdoublenecks » 02. February 2011 19:14

All my system works flawlessly on my win 2000 and winXP machines. They also work on my windows7 machine but I get messages like the below each time. What must I do?

Notice: Use of undefined constant localhost - assumed 'localhost' in C:\xampp\htdocs\hofiles\tenantnumbers.php on line 2

Notice: Use of undefined constant root - assumed 'root' in C:\xampp\htdocs\hofiles\tenantnumbers.php on line 2

Notice: Use of undefined constant prerentdb - assumed 'prerentdb' in C:\xampp\htdocs\hofiles\tenantnumbers.php on line 3
Double your music - double your fun
ckdoublenecks
 
Posts: 16
Joined: 11. July 2010 22:10
Location: Florida

Re: windows7 messages

Postby Altrea » 02. February 2011 19:26

That depends on your code.
Do you use constants by accident (forgotten single-quotes or $-sign)?
Or do you really want to use constants but your constants weren't defined well?

I think that would be clear if you show us your lines 2 and 3 of that file.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: windows7 messages

Postby ckdoublenecks » 02. February 2011 20:43

below is the code
Code: Select all
<?php
mysql_connect(localhost,root,"");
mysql_select_db(prerentdb) or die( "Unable to select database");
if(!empty($_POST["submit"]))
{
 $apt = $_POST['apt'];
 $query="SELECT * FROM payments Where apt='$apt'";
$result=mysql_query($query);
if(mysql_num_rows($result))
{
  echo "<form action='#' method='post'><b>Tenant Phone #s<br><br>";
  echo"<table border='0'>
<tr>
<th>Apt</th>
<th>Tenant</th>
<th>Phone#</th>
<th>Emergency#</th>
<th>Cell#</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['apt'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['phone'] . "</td>";
echo "<td>" . $row['ephone'] . "</td>";
echo "<td>" . $row['cell'] . "</td>";
echo "</tr>";
}
echo "</table>";
echo "</form>";
}
else{echo "no entry for apt $apt ...Select Another?";}
}
?>
<form method="post" action="#">
 <br />
 <input type="text" name="apt"/> <p>
<input type="submit" name="submit" value="selected apartment"/>
</form>
Double your music - double your fun
ckdoublenecks
 
Posts: 16
Joined: 11. July 2010 22:10
Location: Florida

Re: windows7 messages

Postby Altrea » 02. February 2011 20:45

forgotten (single-)quotes.
try this:


Code: Select all
[...]
mysql_connect('localhost','root','');
mysql_select_db('prerentdb') or die( "Unable to select database");
[...]
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: windows7 messages

Postby ckdoublenecks » 02. February 2011 21:08

It doesn't work at all your way
Double your music - double your fun
ckdoublenecks
 
Posts: 16
Joined: 11. July 2010 22:10
Location: Florida

Re: windows7 messages

Postby Altrea » 02. February 2011 21:11

Then i can't help you. PHP is telling you lies :shock:
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: windows7 messages

Postby ckdoublenecks » 02. February 2011 21:13

I forgot to state that I'm using new version of xampp on the windows7 machine ?
Double your music - double your fun
ckdoublenecks
 
Posts: 16
Joined: 11. July 2010 22:10
Location: Florida

Re: windows7 messages

Postby Altrea » 02. February 2011 21:17

Doesn't matter. I use XAMPP Versions from 1.5.3 till actual 1.7.4 on my Windows 7 64 Bit and all are running fine.

PHP tells you, you use constants in line 2 and 3.
You have corrected that with the things of my post.
But your errors (notices) are the same as before.

So, PHP don't tell you the truth.
And at this point, noone can help you.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 57 guests

cron