•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,990 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,762 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 4536 | Replies: 2
![]() |
Try this. I haven't tested it but it should do the trick. The key is to use the @ sign on line 2 to prevent the error message from showing up on the clients browser. Also, if you add or die(mysql_error()) to the end of line 2, the script will stop.
php Syntax (Toggle Plain Text)
$sql="SELECT * FROM $table"; $result=@mysql_query($sql); if (!$result) { echo "No table exists"; // Create a MySQL table $tblname=$_SESSION['ID']; mysql_query("CREATE TABLE $tblname( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(30), age INT)") or die(mysql_error()); echo " so I created one!"; }
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- My SQL Help :( (MySQL)
- query problem (delimiter?) (PHP)
- get html element value using php (PHP)
- Creating a login page in PHP (PHP)
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource (PHP)
- question about connecting odbc to sql through php script (PHP)
- Php newsletter error (PHP)
- MYSQL/PHP variable check (MySQL)
- Variable Validation & MYSQL (PHP)
Other Threads in the PHP Forum
- Previous Thread: Web Address For Free Downloading Of Pdf Copy Of A Php Book
- Next Thread: How Do You Add A Training Function To A Texted Based Game??


Linear Mode