Jump to content

[SOLVED] Quick Question


paulman888888

Recommended Posts

This is my script and i would like to limit how long the name can be, i would like the maxium name lengh to be 14.

<?php
// Insert a row of information into the table "example"
mysql_query("INSERT INTO example 
(name, score) VALUES('" . mysql_real_escape_string($_GET['name']) . "', '" . mysql_real_escape_string($_GET['score']) . "')") 
or die('Theres an error.# Please try again.#');  
echo "Score Uploaded!#";
?>

 

Thankyou

Link to comment
https://forums.phpfreaks.com/topic/108115-solved-quick-question/
Share on other sites

<?php
// Insert a row of information into the table "example"
mysql_query("INSERT INTO example 
(name, score) VALUES('" . mysql_real_escape_string(substr($_GET['name'], 0, 14)) . "', '" . mysql_real_escape_string($_GET['score']) . "')") 
or die('Theres an error.# Please try again.#');  
echo "Score Uploaded!#";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.