eeror in my php/mysql...

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

eeror in my php/mysql...

Postby julyhad » 04. March 2010 10:49

Pls, whenever i used "$sql = "INSERT INTO $tbluser () VALUES ()" statement. I do encounter this error "Parse error: syntax error, unexpected T_VARIABLE". can someone tell me what to do?
julyhad
 
Posts: 5
Joined: 21. February 2010 18:37

Re: eeror in my php/mysql...

Postby Altrea » 04. March 2010 12:36

Look your codelines around.
Missing semicolon/Brackets?
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: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: eeror in my php/mysql...

Postby julyhad » 24. March 2010 17:35

Altrea wrote:Look your codelines around.
Missing semicolon/Brackets?

Pls, Altreal there is nothing like missing semicolon/brackets. but am still facing the problem. What can i do?
thanx,
Julyhad.
julyhad
 
Posts: 5
Joined: 21. February 2010 18:37

Re: eeror in my php/mysql...

Postby Altrea » 24. March 2010 18:07

What error message do you get now?
It's easier to help you if you show us your code.
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: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: eeror in my php/mysql...

Postby JustMe » 24. March 2010 18:36

JulyHad,

If you don't post the actual code that causes the problem, then we can only guess.

eg. What is wrong with this statement: x = a + b ;
It is fine unless I include the previous line which reads a="Hi Mom". Now it's easy to see the problem.

I use insert statements like yours all the time. So without the details, none of us can help you.

If you don't want us to know or you think the code is too complicated to post, that's fine. create a very simple exmple that demonstrates your problem using hard coded values that do not give away anything you hold near and dear.

Justme
JustMe
 
Posts: 12
Joined: 22. March 2010 20:34

Re: eeror in my php/mysql...

Postby julyhad » 16. July 2010 19:03

Thanks, everybody in the house your suggestion has worked for me.
julyhad
 
Posts: 5
Joined: 21. February 2010 18:37

Re: eeror in my php/mysql...

Postby julyhad » 16. July 2010 19:53

$sql = "SELECT * FROM $tbl ";
$res = @mysql_query($sql);
$rows = @mysql_num_rows($res);
if($rows > 0){
while($row = @mysql_fetch_array($res)){
$f_date = kill_null($row['A_Date'], "");
$f_type = kill_null($row['Type'], "");
}
}
@mysql_free_result($res);

My purpose is to display the whole rows and columns in the table but the whole columns are displaying with only one row which is the first row. Pls, what can i do to display the whole rows?
julyhad
 
Posts: 5
Joined: 21. February 2010 18:37

Re: eeror in my php/mysql...

Postby Altrea » 16. July 2010 20:16

julyhad wrote:$sql = "SELECT * FROM $tbl ";
$res = @mysql_query($sql);
$rows = @mysql_num_rows($res);
if($rows > 0){
while($row = @mysql_fetch_array($res)){
$f_date = kill_null($row['A_Date'], "");
$f_type = kill_null($row['Type'], "");
}
}
@mysql_free_result($res);

My purpose is to display the whole rows and columns in the table but the whole columns are displaying with only one row which is the first row. Pls, what can i do to display the whole rows?


You can only get one line because your Variables get overwritten on every round in the while loop.
Either output your rows directly in the while-loop, or create an array.
I really don't know what you are trying there ^^
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: 8293
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 92 guests