Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7444005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:25:24+00:00 2026-05-29T11:25:24+00:00

I have a MySQL db, with a functioning table. I am trying to get

  • 0

I have a MySQL db, with a functioning table. I am trying to get to it via a php page. The whole setup is WAMP2. Everything seems to work OK, I have connected to the MySQL and pulled back a basic ‘select all’ via PHP. I am now trying to search via PHP.

I can test the connection that comes with the install:

<?php 
$link = mysql_connect('localhost','testuser','testpass'); 
if (!$link) { 
    die('Could not connect to MySQL: ' . mysql_error()); 
} 
echo 'Connection OK'; mysql_close($link); 
?>

And I see the ‘Connection OK’ reply. Every attempt to connect with the table has failed in various ways, and I suspect I have something amiss with my config of either apache/php/mysql.

I tried the code here: http://www.tutorialized.com/view/tutorial/PHP-MySQL-database-search/416, and I get an error:

 Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\search3.php on line 22

the line that gets the error?

$trimmed = trim($var) //trim whitespace from the stored variable

// rows to return 

$limit=10;      // line 22

My last attempt is to try this code: http://www.wallpaperama.com/forums/simple-php-mysql-connection-test-script-example-t5702.html which according to its preamble should let me test any connection.

When I run the page, I get errors pointing at any variable I have ‘Notice: Undefined index” or “Notice: Undefined variable:”.

I tried suppressing the warning, by using the @ prefix to a variable to see if it was a critical failure, and I get a follow on error of ‘Parse error: syntax error,’ or similar that relates to the function the variable is invoked for.

I suspect that there is something amiss in the variable declaration / handling, but I don’t know where to look for pointers. I have checked the various logs and there is nothing I can see that illuminates further than the errors thrown on the browser page.

I’m a bit lost as to where to look next – this is my first play with PHP. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:25:26+00:00Added an answer on May 29, 2026 at 11:25 am

    the line

     $trimmed = trim($var) //trim whitespace from the stored variable
    

    is missing a semi-colon.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have had numerous headaches trying to get the MySQL APIs for Perl and
I am trying to retrieve data from MySQL for a flash application via PHP,
I have mysql table that has a column that stores xml as a string.
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
Anyone knows how to get sum of number? For example i have mysql column
I have a MySQL table with approximately 3000 rows per user. One of the
I have 5 MySQL InnoDB tables: Test,InputInvoice,InputLine,OutputInvoice,OutputLine and each is mapped and functioning in
I have MySQL Table with an Order table in a DB this table has
I have this mysql query using PHP and first part is working fine, but
I have MySQL table with the following structure: +---------+--------------+------+-----+---------+----------------+ | Field | Type |

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.