472,980 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,980 software developers and data experts.

Parse error: syntax error, unexpected T_VARIABLE on line 4

I am getting the error Parse error: syntax error, unexpected T_VARIABLE on line 4 but I can't seem to find what is wrong. Could someone please help.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $conn = @mysql_connect("localhost", "root", "password ")
  3.  
  4. $rs1 = @mysql_create_db( $_REQUEST['db'] );
  5.  
  6. $rs2 = @mysql_list_dbs( $conn );
  7. for( $row =0; $row < mysql_num_rows( $rs2 ); $row++ )
  8. { $list .= mysql_tablename( $rs2, $row) ." | "; }
  9. ?>
  10.  
  11. <html>
  12. <head>
  13. <title>Creating databases</title>
  14. </head>
  15. <body>
  16.  
  17. <form action = "<?php echo( $_SERVER['PHP_SELF'] ); ?>"
  18. method="post">Current databases: <?php echo( $list ); ?>
  19. <hr>Name:<input type = "text" name= "db">
  20. <input type = "submit" value = "Create Database">
  21. </form>
  22.  
  23. </body>
  24. </html>
Dec 24 '07 #1
4 4362
pbmods
5,821 Expert 4TB
Heya, NeedHelp. Welcome to TSDN!

You're missing a semicolon on line 2.
Dec 24 '07 #2
Heya, NeedHelp. Welcome to TSDN!

You're missing a semicolon on line 2.
I tried putting that in then the screen just comes up blank. No errors, but nothing else either.
Dec 24 '07 #3
pbmods
5,821 Expert 4TB
Heya, NeedHelp.

Check out this article to find out what is going on.
Dec 24 '07 #4
get rid of the @ in front of mysql commands. That suppresses any error messages you may have from sql. Then rerun the script and see what you get.
In addition to that, you php script should probably execute when you get submit and not on reload.
Dec 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Ehartwig | last post by:
I recently created a script for user verification, solved my emailing issues, and then re-created the script in order to work well with the new PHP 5 that I installed on my server. After...
2
by: aamer | last post by:
can anyone please help me, im getting a dumb: Parse error: syntax error, unexpected T_VARIABLE in /home/jeddah/public_html/lomar/cart/remove.php on line 5 in the following file, <?php...
4
by: bovanshi | last post by:
got this annoying error I'm completly new to php... and i have no clue what is wrong here, from what i can tell there is nothing rong with this code... but that isn't what the borwser say :P ...
1
epots9
by: epots9 | last post by:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/xxx.php on line xxx I get that message when i try to run my...
1
by: mdouble | last post by:
I'm a complete novice with HTML and PHP. Recently I purchased an auto responder that requires me to edit a PHP file during the installation process as per directions provided in a read me file. ...
3
by: SilvaZodiac | last post by:
Hi everyone, I'm still rather new to PHP code, and I have a syntax error. I've tried several different solutions, but it won't fix. It seems to suggest that I need a new bracket somewhere in the...
5
praclarush
by: praclarush | last post by:
I've just started php, and this is a class assignment, but my question is Iím getting this error PHP Parse error: syntax error, unexpected T_IF, expecting T_VARIABLE or '$' in...
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
2
by: fburn | last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux. I receive an error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.